blob: 2d7bd73ab86b782fc58f0e3a1ba3c2dc614891ec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
/*
* Test out ' flag in different locales.
* Michal Jaegermann
* March, 2014
*/
#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
int
main(int argc, char **argv)
{
double t;
if (argc == 1)
return 1;
setlocale(LC_ALL, getenv("LC_ALL"));
sscanf(argv[1], "%lf", &t);
printf("%.2f\n", t);
return 0;
}
|