From c65794b50b1bc729e7a4e940b76a973afa3030b9 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Thu, 11 Nov 2021 14:49:35 -0800 Subject: feat: libfmt prototype added from plan9 --- sys/libfmt/locale.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sys/libfmt/locale.c (limited to 'sys/libfmt/locale.c') 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; +} -- cgit v1.2.1