mbhuiyan has asked for the wisdom of the Perl Monks concerning the following question:
printf("%8.2e\n",0.000123);
This gives me the output in my 32 bit widnows xp as:1.23e-004
The problem is there are 9 characters in the output instead of 8. So, how can I control the number of digits on the exponent so that it prints e-4 or e-04 rather than e-004?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to control no. of digits on exponent
by ikegami (Patriarch) on Dec 31, 2010 at 04:31 UTC | |
by mjscott2702 (Pilgrim) on Dec 31, 2010 at 09:51 UTC | |
|
Re: How to control no. of digits on exponent
by Anonymous Monk on Dec 31, 2010 at 04:02 UTC | |
|
Re: How to control no. of digits on exponent
by Anonymous Monk on Dec 31, 2010 at 03:17 UTC | |
by chrestomanci (Priest) on Dec 31, 2010 at 08:52 UTC | |
|
Re: How to control no. of digits on exponent
by Anonymous Monk on Dec 31, 2010 at 23:47 UTC |