std::moneypunct<CharT,International>::decimal_point,do_decimal_point (3) - Linux Manuals
std::moneypunct<CharT,International>::decimal_point,do_decimal_point: std::moneypunct<CharT,International>::decimal_point,do_decimal_point
Command to display std::moneypunct<CharT,International>::decimal_point,do_decimal_point
manual in Linux: $ man 3 std::moneypunct<CharT,International>::decimal_point,do_decimal_point
NAME
std::moneypunct<CharT,International>::decimal_point,do_decimal_point - std::moneypunct<CharT,International>::decimal_point,do_decimal_point
Synopsis
Defined in header <locale>
public: (1)
CharT decimal_point() const;
protected: (2)
virtual CharT do_decimal_point() const;
1) Public member function, calls the member function do_decimal_point of the most derived class.
2) Returns the character to use as the decimal point separator in monetary I/O if the format uses fractions (that is, if do_frac_digits() is greater than zero). For typical U.S. locales, it is the character '.' (or L'.')
Return value
The object of type CharT holding the decimal point character.
Example
// Run this code
#include <iostream>
#include <iomanip>
#include <locale>
void show_dpt(const char* locname)
{
std::locale loc(locname);
std::cout.imbue(loc);
std::cout << locname << " decimal point is '"
<< std::use_facet<std::moneypunct<char>>(loc).decimal_point()
<< "' for example: " << std::showbase << std::put_money(123);
if (std::use_facet<std::moneypunct<char>>(loc).frac_digits() == 0)
std::cout << " (does not use frac digits) ";
std::cout << '\n';
}
int main()
{
show_dpt("en_US.utf8");
show_dpt("ja_JP.utf8");
show_dpt("sv_SE.utf8");
show_dpt("de_DE.utf8");
}
Output:
en_US.utf8 decimal point is '.' for example: $1.23
ja_JP.utf8 decimal point is '.' for example: ¥123 (does not use frac digits)
sv_SE.utf8 decimal point is ',' for example: 1,23 kr
de_DE.utf8 decimal point is ',' for example: 1,23 €
See also
do_frac_digits provides the number of digits to display after the decimal point
(virtual protected member function)
[virtual]
Pages related to std::moneypunct<CharT,International>::decimal_point,do_decimal_point
- std::moneypunct<CharT,International>::curr_symbol,do_curr_symbol (3) - std::moneypunct<CharT,International>::curr_symbol,do_curr_symbol
- std::moneypunct<CharT,International>::frac_digits,do_frac_digits (3) - std::moneypunct<CharT,International>::frac_digits,do_frac_digits
- std::moneypunct<CharT,International>::grouping,do_grouping (3) - std::moneypunct<CharT,International>::grouping,do_grouping
- std::moneypunct<CharT,International>::moneypunct (3) - std::moneypunct<CharT,International>::moneypunct
- std::moneypunct<CharT,International>::pos_format,do_pos_format,neg_format,do_neg_format (3) - std::moneypunct<CharT,International>::pos_format,do_pos_format,neg_format,do_neg_format
- std::moneypunct<CharT,International>::positive_sign,do_positive_sign,negative_sign, (3) - std::moneypunct<CharT,International>::positive_sign,do_positive_sign,negative_sign,
- std::moneypunct<CharT,International>::positive_sign,do_positive_sign,negative_sign,do_negative_sign (3) - std::moneypunct<CharT,International>::positive_sign,do_positive_sign,negative_sign,do_negative_sign
- std::moneypunct<CharT,International>::thousands_sep,do_thousands_sep (3) - std::moneypunct<CharT,International>::thousands_sep,do_thousands_sep
- std::moneypunct<CharT,International>::~moneypunct (3) - std::moneypunct<CharT,International>::~moneypunct
- std::moneypunct (3) - std::moneypunct
- std::moneypunct_byname (3) - std::moneypunct_byname
- std::money_base (3) - std::money_base
- std::money_get (3) - std::money_get
- std::money_get<CharT,InputIt>::get,do_get (3) - std::money_get<CharT,InputIt>::get,do_get