9
I'm using Russian locale settings on my PC.
If I would set:
class numpunct_withpoint: public numpunct<char>
{
protected:
/// Override the function that gives the decimal separator.
char do_decimal_point() const
{
return '.';
}
};
...
locale loc(std::locale::classic(), new numpunct_withpoint);
std::locale::global(loc);
and than
printf("%f", 3.14);
Output is:
3,14
Decimal separator is "," not like in do_decimal_point function! How can I change C locale settings for decimal separator with C++ locale?
Thanks for answer!
But, does C setlocale function make affect to C++ cout object?
setlocale(LC_NUMERIC, "C");
Would this make affect when printing decimal value via cout?