summaryrefslogtreecommitdiff
path: root/src/vmon.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2025-04-12 15:35:20 -0700
committerVito Caputo <vcaputo@pengaru.com>2025-04-19 12:43:28 -0700
commit7f361151ce53864540cfcff10e694bd557fcdf8f (patch)
tree02d0c4d824e7ca5628dab03e2c56316386a58f17 /src/vmon.c
parent45e1b6d8695f8c4211599d865959602367a779a1 (diff)
vmon: set locale
I'd like to get thousands markers in some of the numbers produced via snprintf in the charts, so call setlocale() with "" so it gets set to whatever the environment has. e.g. LC_ALL=$LANG src/vmon In Arch here gets my LC_ALL set to "en_US.UTF-8", which will put commas in for thousands separators wherever the format modifier "'" has been added.
Diffstat (limited to 'src/vmon.c')
-rw-r--r--src/vmon.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vmon.c b/src/vmon.c
index 74ca857..9b86ad0 100644
--- a/src/vmon.c
+++ b/src/vmon.c
@@ -19,6 +19,7 @@
#include <assert.h>
#include <errno.h>
#include <limits.h>
+#include <locale.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -605,6 +606,7 @@ static vmon_t * vmon_startup(int argc, const char * const *argv)
assert(argv);
+ setlocale(LC_ALL, "");
print_copyright();
vmon = calloc(1, sizeof(vmon_t));
© All Rights Reserved