| Re: printf: zero pad after the decimal a given amount |
|
 |
|
 |
|
 |
|
 |
Group: comp.lang.perl.misc · Group Profile
Author: Frank SeitzFrank Seitz Date: Mar 31, 2008 12:57
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
|