Re: printf: zero pad after the decimal a given amount



szr wrote:
Paul Lalli wrote:

%.03f

$ perl -e'printf("%.03f\n", .1)'
0.100

Paul Lalli

Actually that truncates to 3 decimal places, which isn't what the op

s/truncates/rounds/;

required:

$ perl -e'printf("%.03f\n", .00625)'
0.006

The 0 in .03 is useless.

Frank
--
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel
.



Relevant Pages