Mallik wrote:
> 
> Dear Friends,

Hello,

> How do I format the decimals, i.e, if there is no
> decimal part, then add .00, if there is one decimal,
> then add '0'.
> 
> For eg., how to convert 123 to 123.00
> and 123.5 to 123.50.

printf "%.2f\n", $_ for 123, 123.5;


John
-- 
use Perl;
program
fulfillment

-- 
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