class template
<locale>
std::numpunct
template <class charT> class numpunct;
Numeric punctuation facet
The numpunct standard facet provides information about the format of punctuation marks for numbers and also the strings to represent the true
and false
boolean values.
The numpunct class template has a protected destructor: Programs shall only construct objects of derived classes, or use those installed in locale objects (through use_facet).
All standard locale objects support at least the following facet instantiations of the numpunct class template as part of the numeric category:
facets in locale objects | description |
numpunct<char> | narrow characters |
numpunct<wchar_t> | wide characters |
Template parameters
- charT
- Character type.
This is the type of the representation, not the type of the numerical value: the formatting information is common for all numeric types.
Aliased as member char_type.
Member types
member type | definition | description |
char_type | The template parameter (charT) | Character type |
string_type | basic_string<charT> | The type returned by members truename and falsename
|
Member constants
The class contains a public static constant of type locale::id that uniquely identifies facets with numpunct semantics.
Public member functions
- (constructor)
- numpunct constructor (public member function)
Numerical format
- decimal_point
- Decimal point character (public member function)
- thousands_sep
- Thousands separator character (public member function)
- grouping
- Grouping of digits (public member function)
Boolean values
- truename
- String representation of true (public member function)
- falsename
- String representation of false (public member function)
Virtual protected member functions
The class defines the virtual protected members which implement the behavior by default of their respective member functions:
- do_decimal_point
- Return decimal point character [virtual] (protected virtual member function)
- do_thousands_sep
- Return thousands separator character [virtual] (protected virtual member function)
- do_grouping
- Return grouping of digits [virtual] (protected virtual member function)
- do_truename
- Return string representing true [virtual] (protected virtual member function)
- do_falsename
- Return string representing false [virtual] (protected virtual member function)
Along with the class destructor:
- (destructor)
- numpunct destructor (protected member function)
Specializations
At least the following specializations of this template are provided in all library implementations:
specialization |
numpunct<char> |
numpunct<wchar_t> |