std::money_put
Aus 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. |
<metanoindex/>
<tbody> </tbody>| definiert in Header <locale>
|
||
template< class CharT, class OutputIt = std::ostreambuf_iterator<CharT> > class money_put; |
||
Klasse
std::money_put kapselt die Regeln für die Formatierung monetäre Werte als Zeichenfolgen. Die Standard-I / O Manipulator std::put_money nutzt die std::money_put Facette des I / O-Streams locale .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.
You can help to correct and verify the translation. Click here for instructions.
Inheritance diagram
Type Anforderungen
-InputIt must meet the requirements of InputIterator.
|
Spezialisierungen
Zwei Spezialisierungen und zwei partielle Spezialisierungen werden durch die Standard-Bibliothek zur Verfügung gestellt und werden von allen locale Objekte in einem C + +-Programm erstellt implementiert:
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.
You can help to correct and verify the translation. Click here for instructions.
definiert in Header
<locale> | |
std::money_put<char>
|
erzeugt eine enge String-Darstellungen der monetären Werte
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>
|
schafft große String-Darstellungen der monetären Werte
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>
|
erzeugt eine enge String-Darstellungen von Geldwerten mit benutzerdefinierten Ausgabeiterator
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>
|
schafft große String-Darstellungen von Geldwerten mit benutzerdefinierten Ausgabeiterator
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. |
Mitglied Typen
Mitglied Typ
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
|
Member-Funktionen
baut eine neue money_put Facette 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. (öffentliche Elementfunktion) | |
zerstört sich eine money_put Facette 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. (geschützt Member-Funktion) | |
Beruft 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. (öffentliche Elementfunktion) | |
Geschützt Member-Funktionen
[virtuell] |
Formate einen monetären Wert und schreibt die Ausgabe-Stream 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. (virtuellen geschützten Member-Funktion) |
Mitglied widerspricht
static std::locale::id id |
ID des Gebietsschemas 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. (öffentliche Member-Objekt) |
Beispiel
#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';
}
Output:
american locale: $123,456.79
german locale: 123.456,79 EUR
Siehe auch
definiert Währungsformatierungsregeln Parameter std::money_get und std::money_put verwendet 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. (Klassen-Template) | |
analysiert und konstruiert einen monetären Wert von einem Eingang Zeichenfolge 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. (Klassen-Template) | |
(C++11) |
Formate und gibt ein Geldwert 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. (Funktions-Template) |