For the downvoters: Here's a lib that accomplishes this task that's had a fair bit more than 10 seconds of thought put into it: [0]. Examples [1][2].
:)
[0] http://www.boost.org/doc/libs/1_60_0/libs/locale/doc/html/in...
[1] http://www.boost.org/doc/libs/1_60_0/libs/locale/doc/html/he...
[2] http://www.boost.org/doc/libs/1_60_0/libs/locale/doc/html/me...