在线文档教程
C++
本土化 | Localizations

std::moneypunct

STD:货币量

Defined in header
template< class CharT, bool International = false > class moneypunct;

std::moneypunct封装货币价值格式首选项。流I/O机械手std::get_moneystd::put_money使用std::moneypunctstd::money_getstd::money_put用于解析货币价值输入和格式化货币价值输出。

二次

二次

继承图

标准库提供了四个独立的%28区域设置无关%29的专门化:

在标头中定义<locale>

*。

STD:货币量<char>提供“C”区域设置首选项的等效项。

STD::货币量<wchar[医]T>提供“C”区域设置首选项的宽字符等价物

货币化:货币化<char,true>提供与“C”地区偏好相当的国际货币符号

STD::货币量<wchar[医]T,true>提供了与“C”区域设置首选项的宽字符等效项,并带有国际货币符号。

此外,在C++程序中构造的每个locale对象都实现了自己的%28 locale特定于这些专门化的%29版本。

成员类型

Member typeDefinition
char_typeCharT
string_typestd::basic_string<CharT>

成员函数

(constructor)constructs a new moneypunct facet (public member function)
(destructor)destructs a moneypunct facet (protected member function)
decimal_pointinvokes do_decimal_point (public member function)
thousands_sepinvokes do_thousands_sep (public member function)
groupinginvokes do_grouping (public member function)
curr_symbolinvokes do_curr_symbol (public member function)
positive_signnegative_signinvokes do_positive_sign or do_negative_sign (public member function)
frac_digitsinvokes do_frac_digits (public member function)
pos_formatneg_formatinvokes do_pos_format/do_neg_format (public member function)

受保护成员函数

do_decimal_point virtualprovides the character to use as decimal point (virtual protected member function)
do_thousands_sep virtualprovides the character to use as thousands separator (virtual protected member function)
do_grouping virtualprovides the numbers of digits between each pair of thousands separators (virtual protected member function)
do_curr_symbol virtualprovides the string to use as the currency identifier (virtual protected member function)
do_positive_signdo_negative_sign virtualprovides the string to indicate a positive or negative value (virtual protected member function)
do_frac_digits virtualprovides the number of digits to display after the decimal point (virtual protected member function)
do_pos_formatdo_neg_format virtualprovides the formatting pattern for currency values (virtual protected member function)

成员常数

MemberDefinition
const bool intl (static)International

成员对象

static std::locale::id idid of the locale (public member object)

继承自STD:钱[医]底座

Member typeDefinition
enum part { none, space, symbol, sign, value };unscoped enumeration type
struct pattern { char field4; };the monetary format type

Enumeration constantDefinition
nonewhitespace is permitted but not required except in the last position, where whitespace is not permitted
spaceone or more whitespace characters are required
symbolthe sequence of characters returned by moneypunct::curr_symbol is required
signthe first of the characters returned by moneypunct::positive_sign or moneypunct::negative_sign is required
valuethe absolute numeric monetary value is required

另见

money_basedefines monetary formatting patterns (class)
moneypunct_bynamerepresents the system-supplied std::moneypunct for the named locale (class template)
money_getparses and constructs a monetary value from an input character sequence (class template)
money_putformats a monetary value for output as a character sequence (class template)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/locale/货币化