Re: printf: zero pad after the decimal a given amount
- From: Frank Seitz <devnull4711@xxxxxx>
- Date: Mon, 31 Mar 2008 20:12:34 +0200
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
.
- References:
- printf: zero pad after the decimal a given amount
- From: jidanni
- Re: printf: zero pad after the decimal a given amount
- From: Paul Lalli
- Re: printf: zero pad after the decimal a given amount
- From: szr
- printf: zero pad after the decimal a given amount
- Prev by Date: Re: Sharing a DBI::Mysql database connection with your children
- Next by Date: Re: empty variables - getting rid of "uninitialized value" warnings?
- 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
|