#554369 dash: printf does not respect LC_NUMERIC settings

Package:
dash
Source:
dash
Description:
POSIX-compliant shell
Submitter:
Jakub Wilk
Date:
2026-05-27 15:13:02 UTC
Severity:
normal
Tags:
#554369#5
Date:
2009-11-04 10:14:59 UTC
From:
To:
According to POSIX, LC_NUMERIC "shall affect the format of numbers written
using the e , E , f , g , and G conversion specifier characters (if
supported)."

$ LC_NUMERIC=pl_PL.utf8 bash -c 'printf "%f\n" 42'
42,000000

$ LC_NUMERIC=pl_PL.utf8 dash -c 'printf "%f\n" 42'
42.000000

#554369#14
Date:
2026-05-27 15:12:52 UTC
From:
To:
More than 16 years later, this bug is still there.

The workaround I'm using is to force the use of the external binary
instead of the builtin with the "env" command.

$ printf "%.2f" 0.15
0.15
$ env printf "%.2f" 0.15
0,15

Best regards,
Celelibi