in reply to Eliminating Trailing Zeros
See the sprintf manpage for more details:$ perl -e 'printf "%2.4g\n", 23.05' 23.05 $ perl -e 'printf "%2.4g\n", 23.00' 23
g The double argument is converted in style f or e (or E for G conversions). ... Trailing zeros are removed from the fractional part of the result; ...
--
John.
|
|---|