How to print a double with a comma

后端 未结 6 1320
醉话见心
醉话见心 2020-12-15 10:07

In C++ I\'ve got a float/double variable.

When I print this with for example cout the resulting string is period-delimited.

cout << 3.1415 <         


        
6条回答
  •  心在旅途
    2020-12-15 10:33

    To be precise, this is controlled by the std::numpunct::decimal_point() value. You can imbue() another locale with another decimal_point()

提交回复
热议问题