From ce05175372a9ddca1a225db0765ace1127a39293 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Fri, 12 Nov 2021 09:22:01 -0800 Subject: chore: simplified organizational structure --- src/libfmt/locale.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/libfmt/locale.c (limited to 'src/libfmt/locale.c') diff --git a/src/libfmt/locale.c b/src/libfmt/locale.c new file mode 100644 index 0000000..437c61e --- /dev/null +++ b/src/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; +} -- cgit v1.2.1