I am having no success using the %'d specifier in printf to include the
locales' 1000's separator in a number
i.e. printf "%'d" 123456789 should give 123,456,789 for a UK locale of
en_GB.UTF-8. But it doesn't.
LANG & LC_ALL are set to the above locale.
Any suggestions, anyone? I can use sed to force commas in there but I
would prefer to program cleanly for locales. It IS a global (dud) economy!
On 2012-09-12 08:32Z, William Parker wrote:
> I am having no success using the %'d specifier in printf to include the
> locales' 1000's separator in a number
"%'d" is nonstandard. See:
Personally, I use a subroutine to insert thousands separators.
Or you could try the msw GetNumberFormat() function.
Get latest updates about Open Source Projects, Conferences and News.