2

I use el_GR.UTF-8 which does not group thousands. I changed /usr/share/i18n/locales/el_GR, updated:

sudo locale-gen el_GR
sudo locale-gen el_GR.UTF-8
sudo update-locale LANG=el_GR.UTF-8

but still printf "%'.1f\n" 1000 produces 1000,0 instead of 1.000,0

1

Do not modify files that are manged by your distribution. Do not edit files under /usr except under /usr/local. Your changes will be overridden by the package manager.

If you want to use a different thousands separator, set LC_NUMERIC to a different value.

$ LC_NUMERIC=en_US.UTF-8 printf %\'.1f\\n 1000
$ 1,000.0
  • Thanks for the warning. But I cannot search all LC's to find an exact match. Even worse. As you say if that specific LC change in the future I have to find another. – ilias iliadis Sep 11 '17 at 6:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.