Hi, i'm writing a double value to a file. The numeric value is written with a point as a decimal separator. I would like to use a comma. How i can do that?
A:
Craig
2010-02-09 01:10:41
+2
A:
You can find the answer in an earlier question This basically changes the locale used by the streams you are using.
Michael Anderson
2010-02-09 01:10:59
+3
A:
The usual way is to use a locale with the decimal separator set to the comma. If your machine is configured for that generally, you can probably just use the nameless locale for it:
std::cout.imbue(std::locale(""));
std::cout << 12345.67;
Jerry Coffin
2010-02-09 01:11:32