While it is easy to write something that does this by myself, I often wondered if there was something like this in iomanip or somewhere. However, I never found something useful. Ideally, it’d be sensitive to locales (e.g. in Germany you’d write 1,234,567.89 as 1.234.567,89) and hence highly superior to building the comma-string by hand.
While it is easy to write something that does this by myself, I often
Share
According to this thread, you can set a locale on your output stream by doing something like:
Haven’t tried it myself but it certainly sounds like a reasonable approach.