Re: number_format() = "-0.00"
| From: | Christoph M. Becker | Date: | Fri, 25 Nov 2016 09:58:02 +0000 |
| Subject: | Re: number_format() = "-0.00" | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-97177@lists.php.net to get a copy of this message | ||
On 25.11.2016 at 08:54, Craig Duncan wrote:
> Hi internals,
>
> I've submit a PR (https://github.com/php/php-src/pull/2220) to fix a bug (
> https://bugs.php.net/bug.php?id=73581).
>
> Kalle suggested I run the change by here to see if there are any concerns
> or feedback about merging this?
I have no strong opinion whether the behavior should change or not, but
some quick remarks:
* money_format, NumberFormatter::format(Currency) and sprintf exhibit
the same behavior.
* The IEEE 754 signed zero handling might not necessarily be desired,
as the function returns a string, and the result might be regarded
as exact.
* Is there such a thing like -0.00USD?
* Would the comparison
d == 0 be the correct fix, or do we need an
"epsilon comparison" here?
--
Christoph M. Becker