Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 379 Bytes

bash-locale.md

File metadata and controls

28 lines (19 loc) · 379 Bytes

bash locale

using invariant numeric

LC_NUMERIC="en_US.UTF-8"
printf "%0.2f" 10.2

output is 10.20

using specific numeric

LC_NUMERIC="it_IT.UTF-8"
printf "%0.2f" 10.2

output is bash: printf: 10.2: invalid number

because bash interpret number within numeric locale, so

LC_NUMERIC="it_IT.UTF-8"
printf "%0.2f" 10,2

output is 10,20