Return to the floating point data format of the thousand separator using custom Facet

xiaoxiao2021-03-06  38

class MyNumPut: public numpunct {public: virtual string do_grouping () const {return "/ 003";} virtual char do_thousands_sep () const {return ',';}} format do_grouping returned to separator separators in Number: Locale Loc (std :: locale ("), new mynumput ());

Cout.imbue (LOC);

Cout << std :: fixed << std :: setPrecision (2) << 12343243.443 << ENDL;

转载请注明原文地址:https://www.9cbs.com/read-77033.html

New Post(0)