Thank you for your help - didnt mean to send the last email so many times -
it wont happen again :-)

A

Do not do that. Please. One copy is plenty.

> I am trying to figure out sprint and prinf: what I am trying to do is
> format a number into a currency, so 9.9 would be printed as 9.90
>
> Can anyone give me a simple example of this - i am not having any joy
> by myself :s

Please learn how to use perldoc, Google, &/or books.

The first hit on a Google search for "perldoc sprintf" gives this:

        # Round number to 3 digits after decimal point
        $rounded = sprintf("%.3f", $number);

<http://www.perldoc.com/perl5.8.4/pod/func/sprintf.html>

Hopefully you can figure out how to adapt this for 2 digits.


--
Chris Devers



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