Advertisement
devinteske

localeconv(3) work

Jan 13th, 2016
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include <locale.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. #define LC_DEFAULT "en_US.ISO8859-1"
  6.  
  7. int
  8. main(int argc, char *argv[])
  9. {
  10.     printf("%'10.3f\n", 1000001.010);
  11.     setlocale(LC_NUMERIC,
  12.         getenv("LC_ALL") == NULL && getenv("LC_NUMERIC") == NULL ?
  13.         LC_DEFAULT : "");
  14.     printf("%'10.3f\n", 1000001.010);
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement