aboutsummaryrefslogtreecommitdiffstats
path: root/helpers/tryfmt.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-03-08 22:13:53 +0200
committerArnold D. Robbins <arnold@skeeve.com>2014-03-08 22:13:53 +0200
commit23e7f1057b1abdebb25fc7d2f11ee3f5360976a4 (patch)
treecdd91edb34458798d5c0a65cd4c476b01fbf76ec /helpers/tryfmt.c
parent586bb71fdbeb5041263a3e48392d79c5931df3c4 (diff)
parentc972e253abc34f8bd02f6ade74e7999a2b6d8a08 (diff)
downloadegawk-23e7f1057b1abdebb25fc7d2f11ee3f5360976a4.tar.gz
egawk-23e7f1057b1abdebb25fc7d2f11ee3f5360976a4.tar.bz2
egawk-23e7f1057b1abdebb25fc7d2f11ee3f5360976a4.zip
Merge branch 'gawk-4.1-stable'
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;
+}