By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,169 Members | 1,059 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,169 IT Pros & Developers. It's quick & easy.

Digit grouping

P: n/a
Is it possible to specify digit grouping when writing to an output
stream (so that std::cout << 1234.56789; produces "1 234.567 89", for
example)? If so, how?

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
BigMan wrote:
Is it possible to specify digit grouping when writing to an output
stream (so that std::cout << 1234.56789; produces "1 234.567 89", for
example)? If so, how?


This is all handled in the stream's locale, specifically the num_put
facet. The separators you've asked for don't match any of the usual
locales of which I'm aware, so you may have to create your own -- but
this is usually pretty simple (though I don't recall there being
anything about grouping digits after the decimal point).

--
Later,
Jerry.

The universe is a figment of its own imagination.

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.