Espaces de noms
Variantes
Affichages
Actions

std::numpunct::thousands_sep, std::numpunct::do_thousands_sep

De cppreference.com
< cpp‎ | locale‎ | numpunct

 
 
Bibliothèque localisations
Locales et facettes
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
Classification des caractères
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.
Conversions
Original:
Conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Classes de facettes catégorie de base
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.
Catégories de facettes
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.
Spécifique aux paramètres régionaux facettes
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.
Facettes de conversion de code
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 locale
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::numpunct
Les fonctions membres
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.
numpunct::numpunct
numpunct::~numpunct
numpunct::decimal_point
numpunct::do_decimal_point
numpunct::thousands_sep
numpunct::do_thousands_sep
numpunct::grouping
numpunct::do_grouping
numpunct::truename
numpunct::do_truename
numpunct::falsename
numpunct::do_falsename
 
Defined in header <locale>
public:
char_type thousands_sep() const;
(1)
protected:
char_type virtual do_thousands_sep() const;
(2)
1)
fonction de membre du public, appelle le do_thousands_sep fonction membre de la classe la plus dérivée .
Original:
public member function, calls the member function do_thousands_sep of the most derived class.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
renvoie le caractère à utiliser comme séparateur entre les groupes de chiffres lors de l'analyse ou le formatage des nombres entiers et les parties intégrantes de valeurs à virgule flottante .
Original:
returns the character to be used as the separator between digit groups when parsing or formatting integers and integral parts of floating-point values.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Retourne la valeur

L'objet de char_type type à utiliser comme séparateur de milliers. Les spécialisations standard de std::numpunct retour ’,’ et L’,’ .
Original:
The object of type char_type to use as the thousands separator. The standard specializations of std::numpunct return ’,’ and L’,’.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Exemple

#include <iostream>
#include <locale>
struct space_out : std::numpunct<char> {
    char do_thousands_sep()   const { return ' '; }   // separate with spaces
    std::string do_grouping() const { return "\001"; } // groups of 1 digit
};
int main()
{
    std::cout << "default locale: " << 12345678 << '\n';
    std::cout.imbue(std::locale(std::cout.getloc(), new space_out()));
    std::cout << "locale with modified numpunct: " << 12345678 << '\n';
}

Résultat :

default locale: 12345678
locale with modified numpunct: 1 2 3 4 5 6 7 8

[modifier] Voir aussi

[
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.
]
indique le nombre de chiffres entre chaque paire de milliers séparateurs
Original:
provides the numbers of digits between each pair of thousands separators
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) [edit]