~vcs-imports/gawk/master

« back to all changes in this revision

Viewing changes to helpers/scanfmt.c

  • Committer: Juergen Kahrs
  • Date: 2014-06-24 11:18:33 UTC
  • mfrom: (408.2.336)
  • Revision ID: git-v1:f1245d04a9f076773c60499b468f44ed9c91b59b
Merge remote-tracking branch 'origin/master' into cmake

Show diffs side-by-side

added added

removed removed

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