aboutsummaryrefslogtreecommitdiff
path: root/src/libfmt/locale.c
diff options
context:
space:
mode:
authorNicholas <nbnoll@eml.cc>2021-11-12 09:22:01 -0800
committerNicholas <nbnoll@eml.cc>2021-11-12 09:22:01 -0800
commitce05175372a9ddca1a225db0765ace1127a39293 (patch)
tree5988b4d4f6b402e4953945886fc90aae11203df6 /src/libfmt/locale.c
parentb375f3cdedb5b0e08745d100b40e38d2f8396a58 (diff)
chore: simplified organizational structurelaptop
Diffstat (limited to 'src/libfmt/locale.c')
-rw-r--r--src/libfmt/locale.c16
1 files changed, 16 insertions, 0 deletions
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;
+}