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
特化返回 11。
numpunct<char>'.'
numpunct<wchar_t>L'.'

参数



返回值

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).

示例

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;
}

输出

11 units and 7 quarters total 12.75


数据竞争

访问此分面。

异常安全

强异常保证: 如果抛出异常,则没有副作用。

另见