Find local US number formatting information:
<?php setlocale ( LC_ALL , " US " ) ; $locale_info = localeconv ( ) ; print_r ( $locale_info ) ; ?>The localeconv() function returns an array containing local number and currency format information.
The localeconv() function returns the following array elements:
[decimal_point] - Decimal point character
[thousands_sep] - thousands separator
[int_curr_symbol] - Currency symbol (example: USD)
[currency_symbol] - Currency symbol (example: $)
[mon_decimal_point] - Monetary decimal point character
[mon_thousands_sep] - Currency thousands separator
[positive_sign] - positive character
[negative_sign] - Negative character
[int_frac_digits] - International decimal places
[frac_digits] - local common decimal places
[p_cs_precedes] - True (1) if the currency symbol is displayed before a positive value, False (0) if it is displayed after the positive value
[p_sep_by_space] - True (1) if there is a space between the currency symbol and the positive value, False (0) otherwise
[n_cs_precedes] - True (1) if the currency symbol is displayed before a negative value, False (0) if it is displayed after the negative value
[n_sep_by_space] - True (1) if there is a space between the currency symbol and the negative value, False (0) otherwise
[p_sign_posn] - Formatting options:
0 - Write the quantity and currency symbol in parentheses
1 - add a + sign before the quantity and currency sign
2 - add a + sign after the quantity and currency sign
3 - Add the + sign directly before the currency symbol
4 - Add the + sign directly after the currency symbol
[n_sign_posn] - Formatting options:
0 - Write the quantity and currency symbol in parentheses
1 - Place a - sign before the quantity and currency symbol
2 - add - sign after quantity and currency symbol
3 - Add a - sign directly before the currency symbol
4 - Add a - sign directly after the currency symbol
[grouping] - Array showing combinations of numbers (e.g. 3 indicates 1 000 000)
[mon_grouping] - Array showing combinations of currency numbers (example: 2 indicates 1 00 00 00)
Tip: To define local settings, see the setlocale() function.
Tip: To see all available language codes, visit our Language Codes Reference.
localeconv()
Return value: | Returns data based on the current locale set by setlocale(). |
---|---|
PHP version: | 4.0.5+ |