[ Web Proxy ]
URL:
Viewing: https://ru.cppreference.com/cpp/locale/lconv [Back]  [Original]

std::lconv cppreference.com
cppreference.com

std::lconv

cppreference.com

<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.
Google.
. .

char* decimal_point
,
:
the character used as the decimal point
Google.
. .

( -)
char* thousands_sep
,
:
the character used to separate groups of digits before the decimal point
Google.
. .

( -)
char* grouping
,
:
a string whose elements indicate the sizes of digit groups
Google.
. .

( -)

char* mon_decimal_point
,
:
the character used as the decimal point
Google.
. .

( -)
char* mon_thousands_sep
,
:
the character used to separate groups of digits before the decimal point
Google.
. .

( -)
char* mon_grouping
,
:
a string whose elements indicate the sizes of digit groups
Google.
. .

( -)
char* positive_sign
:
a string used to indicate non-negative monetary quantity
Google.
. .

( -)
char* negative_sign
:
a string used to indicate negative monetary quantity
Google.
. .

( -)

char* currency_symbol
, C
:
the symbol used for currency in the current C locale
Google.
. .

( -)
char frac_digits
:
the number of digits after the decimal point to display in a monetary quantity
Google.
. .

( -)
char p_cs_precedes
1 currency_symbol , 0
:
1 if currency_symbol is placed before non-negative value, 0 if after
Google.
. .

( -)
char n_cs_precedes
1 currency_symbol , 0
:
1 if currency_symbol is placed before negative value, 0 if after
Google.
. .

( -)
char p_sep_by_space
currency_symbol, positive_sign,
:
indicates the separation of currency_symbol, positive_sign, and the non-negative monetary value
Google.
. .

( -)
char n_sep_by_space
currency_symbol, negative_sign,
:
indicates the separation of currency_symbol, negative_sign, and the negative monetary value
Google.
. .

( -)
char p_sign_posn
positive_sign
:
indicates the position of positive_sign in a non-negative monetary value
Google.
. .

( -)
char n_sign_posn
negative_sign
:
indicates the position of negative_sign in a negative monetary value
Google.
. .

( -)

-

char* int_curr_symbol
, C
:
the string used as international currency name in the current C locale
Google.
. .

( -)
char int_frac_digits
:
the number of digits after the decimal point to display in an international monetary quantity
Google.
. .

( -)
char int_p_cs_precedes
1 currency_symbol , 0
:
1 if currency_symbol is placed before non-negative international monetary value, 0 if after
Google.
. .

( -)
char int_n_cs_precedes
1 currency_symbol , 0
:
1 if currency_symbol is placed before negative international monetary value, 0 if after
Google.
. .

( -)
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
Google.
. .

( -)
char int_n_sep_by_space
currency_symbol, negative_sign,
:
indicates the separation of currency_symbol, negative_sign, and the negative international monetary value
Google.
. .

( -)
char int_p_sign_posn
positive_sign
:
indicates the position of positive_sign in a non-negative international monetary value
Google.
. .

( -)
char int_n_sign_posn
negative_sign
:
indicates the position of negative_sign in a negative international monetary value
Google.
. .

( -)


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".
Google.
. .
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:
Google.
. .
0
:
no space separates the currency symbol and the value
Google.
. .
1
, ,
:
sign sticks to the currency symbol, value is separated by a space
Google.
. .
2
. ,
:
sign sticks to the value. Currency symbol is separated by a space
Google.
. .
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:
Google.
. .
0
:
parentheses around the value and the currency symbol are used to represent the sign
Google.
. .
1
:
sign before the value and the currency symbol
Google.
. .
2
,
:
sign after the value and the currency symbol
Google.
. .
3
:
sign before the currency symbol
Google.
. .
4
:
sign after the currency symbol
Google.
. .

#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

Web Proxy Viewer  |  New URL  |  Original Page