Reputation: 942
In my C++ project I am using string formatting as follows -
sprintf(tag, "%g", "100.88");
If I run it in English locale it maps fine. I would like to make changes to it to work in different locales. Like in German locale tag should get assigned as 100,88.
How I can achieve this?
I am looking for something similar to
system.convert.tostring(100.88 ,
system.globalization.culturalinfo.invariantculture)
Upvotes: 1
Views: 312
Reputation: 76788
If you were using iostreams, you'd do this by imbuing the stream with the locale you want to use.
Upvotes: 2