std::numpunct_byname
来自cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <locale>
|
||
| template< class charT > class numpunct_byname : public std::numpunct<charT>; |
||
std::numpunct_byname是一个std::numpunct方面,它封装了一个指定的区域在建设数字标点符号的喜好.
Original:
std::numpunct_byname is a std::numpunct facet which encapsulates numeric punctuation preferences of a locale specified at its construction.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
两个专业所提供的标准库
Original:
Two 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.
You can help to correct and verify the translation. Click here for instructions.
| Defined in header
<locale> | |
| std::numpunct_byname<char> | 窄字符的I / O区域设置特定的std::numpunct方面
Original: locale-specific std::numpunct facet for narrow character I/O The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| std::numpunct_byname<wchar_t> | 区域设置特定的std::numpunct方面为宽字符I / O
Original: locale-specific std::numpunct facet for wide characters I/O 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> |
[编辑] 成员函数
| 构造一个新numpunct_byname方面 Original: constructs a new numpunct_byname facet The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |
| 解构一个numpunct_byname方面 Original: destructs a numpunct_byname facet The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (受保护的成员函数) | |
[编辑] 为例
此示例demonistrates如何应用不改变的区域设置的其余部分的情况下的另一种语言的数字标点规则.
Original:
This example demonistrates how to apply numeric punctuation rules of another language without changing the rest 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.
You can help to correct and verify the translation. Click here for instructions.
#include <iostream> #include <locale> int main() { const double number = 1000.25; std::wcout << L"default locale: " << number << L'\n'; std::wcout.imbue(std::locale(std::wcout.getloc(), new std::numpunct_byname<wchar_t>("ru_RU.UTF8"))); std::wcout << L"default locale with russian numpunct: " << number << L'\n'; }
Output:
default locale: 1000.25 default locale with russian numpunct: 1 000,25
[编辑] 另请参阅
| 定义数字标点规则 Original: defines numeric punctuation rules The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (类模板) | |