I want to create a string in C++ with the following format:
string + numbersWithFormatAndThousandSeparator + string
I am not sure whether std::string
or snprintf()
provides format like that especially the thousand separator. Could someone help me with this?
ss.imbue(std::locale(""));
. This worked. I think that "" selects the default locale for your system, and hopefully that'll be what you, and your users, want. Note thatlocale()
failed (no thousands separator). – Portrait