Re: Round
| From: | Koen van den Boogaart | Date: | Wed, 29 Aug 2007 15:55:06 +0000 |
| Subject: | Re: Round | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-261459@lists.php.net to get a copy of this message | ||
No, I want it to go to float(0), so minus the minus. "-0" doesn't exist in
math, as far as I know. Probably a precision thing.
"Richard Heyes" <richardh@phpguru.org> wrote in message
news:46D58ECC.8010602@phpguru.org...
> Koen van den Boogaart wrote:
>> Is it expected behaviour that
>>
>> <?php var_dump( round(-0.26) ); ?>
>>
>> outputs
>>
>> float(-0)
>
>
> Yes. You (probably) want:
>
> <?php
> var_dump(round(-0.26, 1));
> ?>
>
> http://uk.php.net/manual/en/function.round.php
>
> --
> Richard Heyes
> +44 (0)844 801 1072
> http://www.websupportsolutions.co.uk
>
> Knowledge Base and HelpDesk software
> that can cut the cost of online support