std::money_put
De 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. |
| Défini dans l'entête <locale>
|
||
| template< class CharT, |
||
Classe
std::money_put encapsule les règles de formatage des valeurs monétaires sous forme de chaînes. Le manipulateur std::put_money E / S standard utilise la facette std::money_put de la localisation du flux d'E / S .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.
Sommaire |
[modifier] Exigences de type
-InputIt must meet the requirements of InputIterator.
|
[modifier] Spécialisations
Deux spécialisations et deux spécialisations partielles sont fournies par la bibliothèque standard et sont mises en œuvre par tous les objets créés dans un environnement linguistique programme 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.
You can help to correct and verify the translation. Click here for instructions.
| Defined in header
<locale> | |
| std::money_put<char> | crée une chaine de caractères étroits de valeurs monétaires
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> | crée une chaine de caractères larges de valeurs monétaires
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> | crée une chaine de caractères étroits de valeur monétaire en utilisant un itérateur de sortie personnalisé
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> | crée une chaine de caractères larges de valeur monétaire en utilisant un itérateur de sortie personnalisé
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. |
[modifier] Types de membres
| Type de membre
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
|
[modifier] Les fonctions membres
| construit un nouveau 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. (fonction membre publique) | |
| Détruit une facette 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. (fonction membre protégée) | |
| Invoque 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. (fonction membre publique) | |
[modifier] Protégé fonctions membres
| [ virtuel ]Original: virtual The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
formate une valeur monétaire et écrit dans le flux de sortie 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. (fonction membre virtuelle protégée) |
[modifier] Objets membres
| static std::locale::id id |
Id de la localisation 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. (objet membre public) |
[modifier] Exemple
#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'; }
Résultat :
american locale: $123,456.79 german locale: 123.456,79 EUR
[modifier] Voir aussi
| définit les paramètres de mise en forme monétaire utilisés par std::money_get et 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. (classe générique) | |
| analyse et construit une valeur monétaire à partir d'une séquence de caractères d'entrée 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. (classe générique) | |
| (C++11) |
formats et des sorties d'une valeur monétaire 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. (fonction générique) |
