diff options
author | Nicholas Noll <nbnoll@eml.cc> | 2021-11-11 14:49:35 -0800 |
---|---|---|
committer | Nicholas Noll <nbnoll@eml.cc> | 2021-11-11 14:49:35 -0800 |
commit | c65794b50b1bc729e7a4e940b76a973afa3030b9 (patch) | |
tree | bc435fea0f3179ac9a4b8de9fdaf993dade9e4ff /sys/libfmt/locale.c | |
parent | cc7d219e080263da9813e570436bfd34ab8b1bff (diff) |
feat: libfmt prototype added from plan9
Diffstat (limited to 'sys/libfmt/locale.c')
-rw-r--r-- | sys/libfmt/locale.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/libfmt/locale.c b/sys/libfmt/locale.c new file mode 100644 index 0000000..437c61e --- /dev/null +++ b/sys/libfmt/locale.c @@ -0,0 +1,16 @@ +#include "internal.h" + +void +fmt·setlocale(fmt·State *io, char *decimal, char *thousands, char *groups) +{ + if(decimal == nil || decimal[0] == '\0') + decimal = "."; + if(thousands == nil) + thousands = ","; + if(groups == nil) + groups = "\3"; + + io->groups = groups; + io->decimal = decimal; + io->thousands = thousands; +} |