Created
July 23, 2017 11:43
-
-
Save korli/fd910c63a90a0cedb360a11e94198c4c to your computer and use it in GitHub Desktop.
localeconv example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <locale.h> | |
#include <stdio.h> | |
int main () | |
{ | |
struct lconv * lc; | |
setlocale(LC_ALL, "de_DE.UTF-8"); | |
lc = localeconv(); | |
printf("Local Currency Symbol: %s\n",lc->currency_symbol); | |
printf("International Currency Symbol: %s\n",lc->int_curr_symbol); | |
printf("Decimal Point = %s\n", lc->decimal_point); | |
setlocale(LC_ALL, "it_IT.UTF-8"); | |
lc = localeconv(); | |
printf("Local Currency Symbol: %s\n",lc->currency_symbol); | |
printf("International Currency Symbol: %s\n",lc->int_curr_symbol); | |
printf("Decimal Point = %s\n", lc->decimal_point); | |
setlocale(LC_ALL, "fr_FR.UTF-8"); | |
lc = localeconv(); | |
printf("Local Currency Symbol: %s\n",lc->currency_symbol); | |
printf("International Currency Symbol: %s\n",lc->int_curr_symbol); | |
printf("Decimal Point = %s\n", lc->decimal_point); | |
setlocale(LC_ALL, "en_US.UTF-8"); | |
lc = localeconv(); | |
printf("Local Currency Symbol: %s\n",lc->currency_symbol); | |
printf("International Currency Symbol: %s\n",lc->int_curr_symbol); | |
printf("Decimal Point = %s\n", lc->decimal_point); | |
setlocale(LC_ALL, "en_GB.UTF-8"); | |
lc = localeconv(); | |
printf ("Local Currency Symbol: %s\n",lc->currency_symbol); | |
printf ("International Currency Symbol: %s\n",lc->int_curr_symbol); | |
printf("Decimal Point = %s\n", lc->decimal_point); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment