-
Notifications
You must be signed in to change notification settings - Fork 52
Description
I know the docs say
the ' printf option (format with thousands grouping characters)) has no effect in format.
and the code says
format/include/boost/format/parsing.hpp
Lines 172 to 173 in c1170a6
| case '\'': | |
| break; // no effect yet. (painful to implement) |
but it would be really neat if this could be supported in the future.
I assume the issue is that Boost::format is essentially trying to achieve all (or at least the majority) of its formatting using standard stream flags and there is none for thousands separators?
From https://stackoverflow.com/questions/17530408/print-integer-with-thousands-and-millions-separator it seems that what would be necessary is to use a imbue in combination with a locale.
Has this been considered yet?
EDIT: This approach seems to at least break when using Boost::multiprecision numbers with the stream at which case the thousands separator is ignored again.