in reply to Commify function regex in Perl vs sed

why not:
$ printf "%'f" -987654321.12345 -987,654,321.123450

Replies are listed 'Best First'.
Re^2: Commify function regex in Perl vs sed
by LanX (Saint) on Sep 21, 2025 at 09:42 UTC
    Nota bene:
    • this is a GNU util not Perl's printf
    • it depends on locale.
    I needed a prior export LC_NUMERIC=en_US.utf8 to make this work, otherwise the decimal point is causing an invalid number error.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery