std::moneypunct

来自cppreference.com

 
 
本地化库
语言环境方面
Original:
Locales and facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
locale
字符分类
Original:
Character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
转换
Original:
Conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
wstring_convert(C++11)
wbuffer_convert(C++11)
小面类的基类
Original:
Facet category base classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
小面类
Original:
Facet categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
特定于语言环境的方面
Original:
Locale-specific facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
代码转换方面
Original:
Code conversion facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
codecvt_utf8(C++11)
codecvt_utf16(C++11)
codecvt_utf8_utf16(C++11)
codecvt_mode(C++11)
C语言环境
Original:
C locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
 
Defined in header <locale>
template< class CharT, bool International = false >
class moneypunct;
方面std::moneypunct封装货币值格式的喜好。流I / O操纵std::get_moneystd::put_money使用std::moneypunct通过std::money_getstd::money_put解析货币值的输入和格式化货币值输出.
Original:
The facet std::moneypunct encapsulates monetary value format preferences. Stream I/O manipulators std::get_money and std::put_money use std::moneypunct through std::money_get and std::money_put for parsing monetary value input and formatting monetary value output.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cpp/locale/money basecpp/locale/locale/facetstd-moneypunct-inheritance.svg
关于这幅图像

Inheritance diagram

四个专业所提供的标准库
Original:
Four specializations are provided by the standard library
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <locale>
std::moneypunct<char>
提供等值的“C”语言环境的偏好
Original:
provides equivalents of the "C" locale preferences
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::moneypunct<wchar_t>
提供宽字符当量的“C”语言环境的偏好
Original:
provides wide character equivalents of the "C" locale preferences
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::moneypunct<char, true>
提供等值的“C”语言环境的喜好,与国际货币符号
Original:
provides equivalents of the "C" locale preferences, with international currency symbols
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::moneypunct<wchar_t, true>
提供了宽字符当量的“C”语言环境的喜好,与国际货币符号
Original:
provides wide character equivalents of the "C" locale preferences, with international currency symbols
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目录

[编辑] 会员类型

会员类型
Original:
Member type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
char_type charT
string_type std::basic_string<charT>

[编辑] 成员函数

构造一个新moneypunct方面
Original:
constructs a new moneypunct facet
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成员函数)
解构一个moneypunct方面
Original:
destructs a moneypunct facet
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(受保护的成员函数)
调用do_decimal_point
Original:
invokes do_decimal_point
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成员函数)
调用do_thousands_sep
Original:
invokes do_thousands_sep
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成员函数)
调用do_grouping
Original:
invokes do_grouping
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成员函数)
调用do_curr_symbol
Original:
invokes do_curr_symbol
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成员函数)
调用do_positive_sign
Original:
invokes do_positive_sign
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成员函数)
调用do_negative_sign
Original:
invokes do_negative_sign
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成员函数)
调用do_frac_digits
Original:
invokes do_frac_digits
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成员函数)
调用do_pos_format
Original:
invokes do_pos_format
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成员函数)
调用do_neg_format
Original:
invokes do_neg_format
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成员函数)

[编辑] 受保护的成员函数

[虚拟的] </ SPAN></div></div>
提供要使用的字符作为小数点
Original:
provides the character to use as decimal point
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(虚拟保护成员函数)
[虚拟的] </ SPAN></div></div>
使用千位分隔符的字符
Original:
provides the character to use as thousands separator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(虚拟保护成员函数)
[虚拟的] </ SPAN></div></div>
千位分隔符每一对之间提供的数字的位数
Original:
provides the numbers of digits between each pair of thousands separators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(虚拟保护成员函数)
[虚拟的] </ SPAN></div></div>
提供的字符串使用的货币标识符
Original:
provides the string to use as the currency identifier
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(虚拟保护成员函数)
[虚拟的] </ SPAN></div></div>
提供的字符串,以指示一个正值
Original:
provides the string to indicate a positive value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(虚拟保护成员函数)
[虚拟的] </ SPAN></div></div>
提供的字符串来表示一个负值
Original:
provides the string to indicate a negative value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(虚拟保护成员函数)
[虚拟的] </ SPAN></div></div>
提供显示小数点后的数字位数
Original:
provides the number of digits to display after the decimal point
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(虚拟保护成员函数)
[虚拟的] </ SPAN></div></div>
提供的格式模式为正值
Original:
provides the formatting pattern for positive values
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(虚拟保护成员函数)
[虚拟的] </ SPAN></div></div>
提供的格式模式为负值
Original:
provides the formatting pattern for negative values
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(虚拟保护成员函数)

[编辑] 会员常数

会员
Original:
Member
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
const bool intl (静态的) International

[编辑] 会员对象

static std::locale::id id
“ID”的语言环境
Original:
id of the locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(公共成员对象)

Inherited from std::money_base

会员类型
Original:
Member type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
enum part { none, space, symbol, sign, value };
无作用域的枚举类型
Original:
unscoped enumeration type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
struct pattern { char field[4]; };
货币格式类型
Original:
the monetary format type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
枚举常量
Original:
Enumeration constant
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
none
空格被允许的,但不是必需的,除了在最后一个位置,空白是不被允许的
Original:
whitespace is permitted but not required except in the last position, where whitespace is not permitted
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
space
一个或多个空格字符是必需的
Original:
one or more whitespace characters are required
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
symbol
返回由moneypunct :: curr_symbol的字符的序列是必需的
Original:
the sequence of characters returned by moneypunct::curr_symbol is required
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
sign
第一由moneypunct :: positive_sign或moneypunct返回的字符:: negative_sign是必需的
Original:
the first of the characters returned by moneypunct::positive_sign or moneypunct::negative_sign is required
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
value
绝对数字货币的价值是必需的
Original:
the absolute numeric monetary value is required
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 为例

#include <iostream>
#include <locale>
int main()
{
    std::locale jp("ja_JP.UTF-8");
    std::cout << "japanese currency symbol is "
              << std::use_facet<std::moneypunct<char, true>>(jp).curr_symbol()
              << "or "
              << std::use_facet<std::moneypunct<char>>(jp).curr_symbol()
              << " for short\n";
}

Output:

japanese currency symbol is JPY or ¥ for short

[编辑] 另请参阅

定义货币的格式化模式
Original:
defines monetary formatting patterns
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类) [edit]
代表系统提供std::moneypunct命名的语言环境
Original:
represents the system-supplied std::moneypunct for the named locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
解析和构造的货币价值,从一个输入字符序列
Original:
parses and constructs a monetary value from an input character sequence
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]
输出一个字符序列格式的货币价值
Original:
formats a monetary value for output as a character sequence
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(类模板) [edit]

来自“http://zh.cppreference.com/mwiki/index.php?title=cpp/locale/moneypunct&oldid=28000