Re: how to keep decimals from rounding
| From: | DvDmanDT | Date: | Mon, 25 Aug 2003 21:50:20 +0000 |
| Subject: | Re: how to keep decimals from rounding | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-160684@lists.php.net to get a copy of this message | ||
use floor(), I think that rounds it down... ceil() rounds it up...
--
// DvDmanDT
MSN: dvdmandt@hotmail.com
Mail: dvdmandt@telia.com
"Rob Yelvington" <robert@yelvington.net> skrev i meddelandet
news:20030825202127.895.qmail@pb1.pair.com...
> Is there a way to surpress round() or number_format() from rounding
> decimal places?
>
> I have a value of ".253338" being returned via a calc function.
>
> I take that value and multiply by 100 because I want "25.333" to be
> displayed.
>
> I've used round(), sprintf(), and number_format() and each of them
> rounds the value up.
>
> I had a problem with precision earlier which I solved...my 'precision'
> setting in php.ini was set too low. Is there something in php.ini that
> controls rounding?
>
> Any heads up are appreciated!
>
> Thanks,
>
> ~Rob