public member function
<locale>

std::numpunct::decimal_point

char_type decimal_point() const;
Decimal point character
Returns the character used to represent the decimal radix separator.

Internally, this function simply calls the virtual protected member do_decimal_point, which for the standard specializations returns:
specializationreturns
numpunct<char>'.'
numpunct<wchar_t>L'.'

Parameters

none

Return value

The character used as decimal separator.
Member type char_type is the facet's character type (defined as an alias of numpunct's template parameter, charT).

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
// numpunct::decimal_point example
#include <iostream>       // std::cout
#include <locale>         // std::locale, std::numpunct, std::use_facet

int main ()
{
  int nUnits=11;
  int nQuarters=7;
  char point = std::use_facet< std::numpunct<char> >(std::cout.getloc()).decimal_point();
  std::cout << nUnits << " units and " << nQuarters << " quarters total ";
  std::cout << (nUnits+nQuarters/4) << point << (25*(nQuarters%4)) << '\n';
  return 0;
} 


Output:

11 units and 7 quarters total 12.75

Data races

The facet is accessed.

Exception safety

Strong guarantee: No side effects in case an exception is thrown.

See also