std::money_put
De cppreference.com
|
|
Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate.
La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
| Definido en el archivo de encabezado <locale>
|
||
template<
class CharT,
class OutputIt = std::ostreambuf_iterator<CharT>
> class money_put;
|
||
Clase
std::money_put encapsula las reglas para dar formato a los valores monetarios como cadenas. El estándar de E / S std::put_money manipulador utiliza la faceta std::money_put de la configuración regional del flujo de I / O .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
Tipo de requisitos
-InputIt debe reunir los requerimientos de InputIterator.
|
Especializaciones
Dos especializaciones y dos especializaciones parciales son proporcionados por la biblioteca estándar y son aplicadas por todos los objetos creados en un entorno nacional C + + programa:
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.
Definido en el encabezado
<locale> | |
std::money_put<char>
|
crea representaciones estrechas de cadena de valores monetarios
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>
|
crea representaciones de ancho de cadena de valores monetarios
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>
|
crea representaciones estrechas de cadena de valores monetarios utilizando iterador de salida personalizado
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>
|
crea representaciones de ancho de cadena de valores monetarios utilizando iterador de salida personalizado
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. |
Tipos de miembros
Miembro de tipo
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
|
Las funciones miembro
construye una nueva faceta 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. (función miembro pública) | |
destructs una faceta 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. (función miembro protegida) | |
Invoca 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. (función miembro pública) |
Protegido funciones miembro
[virtual] |
da formato a un valor monetario y escribe a la corriente de salida 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. (función miembro virtual protegida) |
Objetos miembros
static std::locale::id id |
Identificador de la configuración regional 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. (objeto miembro público) |
Ejemplo
Ejecuta este código
#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';
}
Salida:
american locale: $123,456.79
german locale: 123.456,79 EUR
Ver también
| Define los parámetros de formato monetario utilizados por std::money_get y std::money_put. (plantilla de clase) | |
| Analiza y construye un valor monetario a partir de una secuencia de caracteres de entrada. (plantilla de clase) | |
(C++11) |
formatos y salidas de un valor monetario 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. (plantilla de función) |