Пространства имён
Варианты
Действия

std::money_put

Материал из 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.
Facet классов категории базу
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.
Facet категорий
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)
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.
 
std::money_put
Член функций
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
money_put::money_put
money_put::~money_put
money_put::put
money_put::do_put
 
Заголовочный файл <locale>
template<

    class CharT,
    class OutputIt = std::ostreambuf_iterator<CharT>

> class money_put;
Класс std::money_put инкапсулирует правила для форматирования денежных значений в виде строк. Стандартного ввода / вывода манипулятор std::put_money использует std::money_put аспект языка ввода / вывода потока.
Original:
Class std::money_put encapsulates the rules for formatting monetary values as strings. The standard I/O manipulator std::put_money uses the std::money_put facet of the I/O stream's locale.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cpp/locale/locale/facetstd-money put-inheritance.svg
Описание изображения

Диаграмма наследования

Содержание

[править] Тип требованиям

-
InputIt должен соответствовать требованиям InputIterator.

[править] Специализации

Две специализации и два частичных специализаций предусмотрены стандартные библиотеки и осуществляются все локали объекты, созданные в C + + программ
Original:
Two specializations and two partial specializations are provided by the standard library and are implemented by all locale objects created in a C++ program:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Определено в файле <locale>
std::money_put<char>
создает узкое представление строки денежной ценности
Original:
creates narrow string representations of monetary values
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::money_put<wchar_t>
создает широкие строковые представления денежных значений
Original:
creates wide string representations of monetary values
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::money_put<char, OutputIt>
создает узкое представление строки денежных значений с помощью пользовательского итератора вывода
Original:
creates narrow string representations of monetary values using custom output iterator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::money_put<wchar_t, OutputIt>
создает широкие строковые представления денежных значений с помощью пользовательского итератора вывода
Original:
creates wide string representations of monetary values using custom output iterator
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>
iter_type OutputIt

[править] Член функций

строит новую грань money_put
Original:
constructs a new money_put facet
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(public функция-член)
разрушает money_put грань
Original:
destructs a money_put facet
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(protected функция-член)
Вызывает do_put
Original:
invokes do_put
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(public функция-член)

[править] Охраняемые функций-членов

[virtual]
Форматы в денежном выражении и записывает в выходной поток
Original:
formats a monetary value and writes to output stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(virtual protected функция-член)

[править] Член объектов

static std::locale::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.

(public объект-член)

[править] Пример

#include <iostream>
#include <locale>
#include <iomanip>
#include <iterator>
int main()
{
    // using the IO manipulator
    std::cout.imbue(std::locale("en_US.UTF-8"));
    std::cout << "american locale: "
               << std::showbase << std::put_money(12345678.9)<< '\n';
 
    // using the facet directly
    std::cout.imbue(std::locale("de_DE"));
    std::cout << "german locale: " ;
    std::ostreambuf_iterator<char> out(std::cout);
    auto& f = std::use_facet<std::money_put<char>>(std::cout.getloc());
    f.put(out, false, std::cout, std::cout.fill(), 12345678.9 );
    std::cout << '\n';
}

Вывод:

american locale: $123,456.79
german locale: 123.456,79 EUR

[править] См. также

определяет денежно параметров форматирования используется 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.

(шаблон класса) [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]
(C++11)
Форматы и выходы в денежном выражении
Original:
formats and outputs a monetary value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(шаблон функции)