--- "Balint, Jess" <[EMAIL PROTECTED]> wrote:
> Hello all. I have a script that uses alot of data and
> calculates a cumulative percent of this data. That
> cumulative percent should be 100.00 at the end. What I
> get is:
> 
> 99.9999999999998
> 
> I need to truncate this to 2 decimal places and
> hopefully round it to 100.00. Thanks in advance.

Easy.

$var = sprintf(".2f", $var);

Jonathan Paton
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to