aboutsummaryrefslogtreecommitdiffstats
path: root/helpers/tryfmt.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-04-11 07:44:22 +0300
committerArnold D. Robbins <arnold@skeeve.com>2014-04-11 07:44:22 +0300
commitebb6772e9eabeb81e3cc9305a6bec7adf7aad450 (patch)
tree2cf743f82791db19cc7e31cab86b1fc9a4d5ddbb /helpers/tryfmt.c
parente069c636968370f0899d5e4ebaeb9c2341804245 (diff)
parenta4b59faf911743b30f2e6e979c4f9c1ea0669ac3 (diff)
downloadegawk-ebb6772e9eabeb81e3cc9305a6bec7adf7aad450.tar.gz
egawk-ebb6772e9eabeb81e3cc9305a6bec7adf7aad450.tar.bz2
egawk-ebb6772e9eabeb81e3cc9305a6bec7adf7aad450.zip
Merge branch 'master' into comment
Diffstat (limited to 'helpers/tryfmt.c')
-rw-r--r--helpers/tryfmt.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/helpers/tryfmt.c b/helpers/tryfmt.c
new file mode 100644
index 00000000..8166d3f1
--- /dev/null
+++ b/helpers/tryfmt.c
@@ -0,0 +1,23 @@
+/*
+ * Test out ' flag in different locales.
+ * Michal Jaegermann
+ * March, 2014
+ */
+
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+int
+main(int argc, char **argv)
+{
+ const char *fmt;
+ if (argc == 1)
+ fmt = "%'.2f";
+ else
+ fmt = argv[1];
+
+ setlocale(LC_ALL, getenv("LC_ALL"));
+ printf(fmt, 12456789.01);
+ printf("\n");
+ return 0;
+}