Re: printf: zero pad after the decimal a given amount
- From: Frank Seitz <devnull4711@xxxxxx>
- Date: Mon, 31 Mar 2008 21:57:23 +0200
Dr.Ruud wrote:
$ 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
;)
And how do you deal with negative numbers and numbers >= 10? ;)
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
.
- References:
- printf: zero pad after the decimal a given amount
- From: jidanni
- Re: printf: zero pad after the decimal a given amount
- From: Dr.Ruud
- printf: zero pad after the decimal a given amount
- Prev by Date: Re: printf: zero pad after the decimal a given amount
- 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):
Relevant Pages
|