summaryrefslogtreecommitdiff
path: root/helpers/tryfmt.c
blob: 8166d3f1072969cf11abb9c4c264d5f566c50ff6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;
}