std::moneypunct_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. |
| Заголовочный файл <locale>
|
||
| template< class charT, bool Intl = false > class moneypunct_byname : public std::moneypunct<charT, Intl>; |
||
std::moneypunct_byname является std::moneypunct аспект, который инкапсулирует денежные преференции форматирования языка указано на его строительство.
Original:
std::moneypunct_byname is a std::moneypunct facet which encapsulates monetary formatting 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.
| Определено в файле <locale>
| |
| std::moneypunct_byname<char, Intl> | локалей грань std::moneypunct для узкого характера I / O
Original: locale-specific std::moneypunct 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::moneypunct_byname<wchar_t, Intl> | локалей грань std::moneypunct для широкого символа I / O
Original: locale-specific std::moneypunct facet for wide 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. |
Содержание |
[править] Член типов
| Член типа
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 |
pattern
|
std::money_base::pattern |
string_type
|
std::basic_string<charT> |
[править] Член функций
| строит новую грань moneypunct_byname Original: constructs a new moneypunct_byname facet The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (public функция-член) | |
| разрушает moneypunct_byname грань Original: destructs a moneypunct_byname facet The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (protected функция-член) | |
[править] Пример
Этот пример demonistrates, как применять денежные правил форматирования другой язык без изменения остальной части языка .
Original:
This example demonistrates how to apply monetary formatting 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 <iomanip> #include <locale> int main() { long double mon = 1234567; std::locale::global(std::locale("en_US.utf8")); std::wcout.imbue(std::locale()); std::wcout << L"american locale : " << std::showbase << std::put_money(mon) << '\n'; std::wcout.imbue(std::locale(std::wcout.getloc(), new std::moneypunct_byname<wchar_t>("ru_RU.utf8"))); std::wcout << L"american locale with russian moneypunct: " << std::put_money(mon) << '\n'; }
Вывод:
american locale : $12,345.67 american locale with russian moneypunct: 12 345.67 руб
[править] См. также
| определяет денежно параметров форматирования используется std::money_get и std::money_put Original: defines monetary formatting parameters used by std::money_get and std::money_put The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон класса) | |