std::lconv
<clocale>
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.
Contents
[edit] Member objects
[edit] Non-monetary numeric formatting parameters
(public member object)
(public member object)
(public member object)
[edit] Monetary numeric formatting parameters
(public member object)
(public member object)
(public member object)
(public member object)
(public member object)
[edit] Local monetary numeric formatting parameters
(public member object)
(public member object)
(public member object)
(public member object)
currency_symbol
, positive_sign
, and the non-negative monetary value (public member object)
currency_symbol
, negative_sign
, and the negative monetary value (public member object)
positive_sign
in a non-negative monetary value (public member object)
negative_sign
in a negative monetary value (public member object)
[edit] International monetary numeric formatting parameters
(public member object)
(public member object)
(public member object)
(public member object)
int_curr_symbol
, positive_sign
, and the non-negative international monetary value (public member object)
int_curr_symbol
, negative_sign
, and the negative international monetary value (public member object)
positive_sign
in a non-negative international monetary value (public member object)
negative_sign
in a negative international monetary value (public member object)
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円".
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:
The values of p_sign_posn
, n_sign_posn
, int_p_sign_posn
, int_n_sign_posn
are interpreted as follows:
[edit] Example
#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"; }
Output:
Japanese currency symbol: \(JPY )
[edit] See also
(class template) [edit]