Skip to content

Commit

Permalink
options/internal: Add support for RADIXCHAR and THOUSEP in nl_langinfo
Browse files Browse the repository at this point in the history
Also adds DECIMAL_POINT and THOUSAND_SEP which seem to be aliases
originating from glibc.
  • Loading branch information
lzcunt committed Jan 29, 2025
1 parent 4f19cff commit 65b8589
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions options/internal/generic/locale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ char *nl_langinfo(nl_item item) {
return const_cast<char *>("%I:%M:%S %p");
}else if(item == D_T_FMT) {
return const_cast<char *>("%a %b %e %T %Y");
} else if (item == RADIXCHAR) {
return const_cast<char *>(".");
} else if (item == THOUSEP) {
return const_cast<char *>("");
}else if(item == YESEXPR) {
return const_cast<char *>("^[yY]");
}else if(item == NOEXPR) {
Expand Down
2 changes: 2 additions & 0 deletions options/internal/include/bits/nl_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ typedef int nl_item;
#define CRNCYSTR 0x40000

#define RADIXCHAR 0x50000
#define DECIMAL_POINT RADIXCHAR
#define THOUSEP 0x50001
#define THOUSANDS_SEP THOUSEP

#define YESEXPR 0x70000
#define NOEXPR 0x70001
Expand Down

0 comments on commit 65b8589

Please sign in to comment.