Hi, how is it possible to prefix a leading zero to the $Count result below when this value is less than 100.0000 ?

while ($count < 110.000) {
   $count += 10;
   $Count = sprintf "%03.4f", $count;
   print "Count is now $Count\n";
}

I am using %03.4f to provide output that looks like 100.0000
I would like number less than 100.0000 to look like 099.0000
I would like to keep the 3 digits prior to the decimal point either with or without the leading zero as required.

Any suggestions welcomed.

Thanks

John.



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to