Re: Floating numbers truncating to two digits without rounding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 09 January 2006 03:20 pm, Mark Steudel wrote:
> I am calculating things like tax and want to format them so they only have
> 2 digits past the decimal point. I've been using sprintf but just noticed
> that it tends to round up. I want the same functionlity without rounding.
>
> Thanks

You could try number_format() though I haven't looked to see if it rounds up 
or not.

-- 
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
http://www.americanstudentloan.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux