std::lconv
cppreference.com
[] |
Google. . , . , . |
<metanoindex/>
<tbody> </tbody> struct lconv; |
||
std::lconv , C. std::localeconv. std::lconv char char*. char* decimal_point , ( C-). char , CHAR_MAX, C.:
The class
std::lconv contains numeric and monetary formatting rules as defined by a C locale. Objects of this struct may be obtained with std::localeconv. The members of std::lconv are values of type char and of type char*. Each char* member except decimal_point may be pointing at a null character (that is, at an empty C-string). The members of type char are all non-negative numbers, any of which may be CHAR_MAX if the corresponding value is not available in the current C locale.char* decimal_point |
, ( -) |
char* thousands_sep |
, ( -) |
char* grouping |
, ( -) |
char* mon_decimal_point |
, ( -) |
char* mon_thousands_sep |
, ( -) |
char* mon_grouping |
, ( -) |
char* positive_sign |
( -) |
char* negative_sign |
( -) |
char* currency_symbol |
, C ( -) |
char frac_digits |
( -) |
char p_cs_precedes |
1 currency_symbol , 0( -) |
char n_cs_precedes |
( -) |
char p_sep_by_space |
currency_symbol, positive_sign, : indicates the separation of currency_symbol, positive_sign, and the non-negative monetary value( -) |
char n_sep_by_space |
currency_symbol, negative_sign, : indicates the separation of currency_symbol, negative_sign, and the negative monetary value( -) |
char p_sign_posn |
positive_sign ( -) |
char n_sign_posn |
negative_sign ( -) |
-
char* int_curr_symbol |
, C ( -) |
char int_frac_digits |
: the number of digits after the decimal point to display in an international monetary quantity ( -) |
char int_p_cs_precedes |
1 currency_symbol , 0: 1 if currency_symbol is placed before non-negative international monetary value, 0 if after( -) |
char int_n_cs_precedes |
1 currency_symbol , 0: 1 if currency_symbol is placed before negative international monetary value, 0 if after( -) |
char int_p_sep_by_space |
currency_symbol, positive_sign, : indicates the separation of currency_symbol, positive_sign, and the non-negative international monetary value( -) |
char int_n_sep_by_space |
currency_symbol, negative_sign, : indicates the separation of currency_symbol, negative_sign, and the negative international monetary value( -) |
char int_p_sign_posn |
positive_sign : indicates the position of positive_sign in a non-negative international monetary value( -) |
char int_n_sign_posn |
negative_sign ( -) |
C-,
grouping mon_grouping . '\0' , . CHAR_MAX , . "\003".:
The characters of the C-strings pointed to by
grouping and mon_grouping are interpreted according to their numeric values. When the terminating '\0' is encountered, the last value seen is assumed to repeat for the remainder of digits. If CHAR_MAX is encountered, no further digits are grouped. the typical grouping of three digits at a time is "\003".p_sep_by_space, n_sep_by_space, int_p_sep_by_space, int_n_sep_by_space ::
The values of
p_sep_by_space, n_sep_by_space, int_p_sep_by_space, int_n_sep_by_space are interpreted as follows:| 0 | |
| 1 | , ,
|
| 2 | . ,
|
p_sign_posn, n_sign_posn, int_p_sign_posn, int_n_sign_posn ::
The values of
p_sign_posn, n_sign_posn, int_p_sign_posn, int_n_sign_posn are interpreted as follows:| 0 | |
| 1 | |
| 2 | ,
|
| 3 | |
| 4 |
#include <clocale>
#include <iostream>
int main()
{
std::setlocale(LC_ALL, "ja_JP.UTF-8");
std::lconv* lc = std::localeconv();
std::cout << "Japanese currency symbol: " << lc->currency_symbol
<< '(' << lc->int_curr_symbol << ")\n";
}
:
Japanese currency symbol: (JPY )
.
| () | |
| ( ) | |
| , std::money_get std::money_put ( ) | |
C lconv
| |