[RFC] Prevent number_format() from returning negative zero
| From: | Craig Duncan | Date: | Sat, 01 Apr 2017 15:33:25 +0000 |
| Subject: | [RFC] Prevent number_format() from returning negative zero | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-98719@lists.php.net to get a copy of this message | ||
Hi internals.
Following a brief discussion on the behaviour of number_format() last year
I'd like to start discussion around an RFC to bring consistency to negative
zero.
When number_format() is passed -0 it doesn't display the negative sign,
however if it's passed something that rounds to -0 then it does display the
negative sign.
https://3v4l.org/k4roB
I believe these two operations should yield the same result. The RFC takes
the stance that the rounding version should be changed to never display -0,
but I'm open to hearing arguments to change number_format() to always
display the negative sign when it's working with a negative number.
https://wiki.php.net/rfc/number_format_negative_zero
Thanks,
Craig