Thousand separator in C++ -


i want create string in c++ following format:

string + numberswithformatandthousandseparator + string 

i not sure whether std::string or snprintf() provides format thousand separator. me this?

fast , easy way:

std::ostringstream ss; ss.imbue(std::locale("en_us.utf-8")); ss << 1033224.23; return ss.str(); 

would return string "1,033,244.23"

but requires en_us.utf-8 locale configured on system.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -