Re: printf: zero pad after the decimal a given amount
- From: "Dr.Ruud" <rvtol+news@xxxxxxxxxxxx>
- Date: Mon, 31 Mar 2008 21:22:59 +0200
jidanni@xxxxxxxxxxx schreef:
Why is there no way to tell printf to zero pad like the right column:
0.1 :0.100
0.05 :0.050
0.03 :0.030
0.025 :0.025
0.02 :0.020
0.015 :0.015
0.0125 :0.0125
0.01 :0.010
0.009 :0.009
0.00625:0.00625
0.005 :0.005
$ perl -wle'
print "".reverse sprintf "%05.1f", "".reverse sprintf "%f", $_
for qw/.1 .05 .03 .025 .02 .015 .0125 .01 .009 .00625 .005
1.987654321E1/
'
0.100
0.050
0.030
0.025
0.020
0.015
0.0125
0.010
0.009
0.00625
0.005
9.876543
;)
--
Affijn, Ruud
"Gewoon is een tijger."
.
- Follow-Ups:
- Re: printf: zero pad after the decimal a given amount
- From: Frank Seitz
- Re: printf: zero pad after the decimal a given amount
- References:
- printf: zero pad after the decimal a given amount
- From: jidanni
- printf: zero pad after the decimal a given amount
- Prev by Date: FAQ 8.3 How do I do fancy stuff with the keyboard/screen/mouse?
- Next by Date: Re: printf: zero pad after the decimal a given amount
- Previous by thread: Re: printf: zero pad after the decimal a given amount
- Next by thread: Re: printf: zero pad after the decimal a given amount
- Index(es):