std::numpunct<CharT>::thousands_sep,do_thousands_sep (3) - Linux Manuals
std::numpunct<CharT>::thousands_sep,do_thousands_sep: std::numpunct<CharT>::thousands_sep,do_thousands_sep
Command to display std::numpunct<CharT>::thousands_sep,do_thousands_sep
manual in Linux: $ man 3 std::numpunct<CharT>::thousands_sep,do_thousands_sep
NAME
std::numpunct<CharT>::thousands_sep,do_thousands_sep - std::numpunct<CharT>::thousands_sep,do_thousands_sep
Synopsis
Defined in header <locale>
public: (1)
char_type thousands_sep() const;
protected: (2)
virtual char_type do_thousands_sep() const;
1) Public member function, calls the member function do_thousands_sep of the most derived class.
2) Returns the character to be used as the separator between digit groups when parsing or formatting integers and integral parts of floating-point values.
Return value
The object of type char_type to use as the thousands separator. The standard specializations of std::numpunct return ',' and L','.
Example
// Run this code
#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 "\1"; } // 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';
}
Output:
default locale: 12345678
locale with modified numpunct: 1 2 3 4 5 6 7 8
See also
do_grouping provides the numbers of digits between each pair of thousands separators
(virtual protected member function)
[virtual]
Pages related to std::numpunct<CharT>::thousands_sep,do_thousands_sep
- std::numpunct<CharT>::truename,do_truename,falsename,do_falsename (3) - std::numpunct<CharT>::truename,do_truename,falsename,do_falsename
- std::numpunct<CharT>::decimal_point,do_decimal_point (3) - std::numpunct<CharT>::decimal_point,do_decimal_point
- std::numpunct<CharT>::grouping,std::numpunct<CharT>::do_grouping (3) - std::numpunct<CharT>::grouping,std::numpunct<CharT>::do_grouping
- std::numpunct<CharT>::numpunct (3) - std::numpunct<CharT>::numpunct
- std::numpunct<CharT>::~numpunct (3) - std::numpunct<CharT>::~numpunct
- std::numpunct (3) - std::numpunct
- std::numpunct_byname (3) - std::numpunct_byname
- std::num_get (3) - std::num_get
- std::num_get<CharT,InputIt>::get,std::num_get<CharT,InputIt>::do_get (3) - std::num_get<CharT,InputIt>::get,std::num_get<CharT,InputIt>::do_get
- std::num_get<CharT,InputIt>::num_get (3) - std::num_get<CharT,InputIt>::num_get
- std::num_get<CharT,InputIt>::~num_get (3) - std::num_get<CharT,InputIt>::~num_get
- std::num_put (3) - std::num_put