in reply to Zero Padding to the Right of the Decimal
But on the following line you convert it back to a number*:$i=sprintf("%3.2f",$i);
So either do the increment before you do the sprintf or else just use printf:$i=$i+0.1;
printf "%3.2f\n", $i;
--
John.
* Internally it will be both a number and a string.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Zero Padding to the Right of the Decimal
by KPeter0314 (Deacon) on Jan 15, 2004 at 19:09 UTC | |
by Cody Pendant (Prior) on Jan 15, 2004 at 20:40 UTC | |
by boo_radley (Parson) on Jan 15, 2004 at 20:54 UTC | |
by revdiablo (Prior) on Jan 15, 2004 at 21:54 UTC | |
by Not_a_Number (Prior) on Jan 15, 2004 at 20:59 UTC |