Req #69161 [Asn->Opn]: Removing Signed Zeros - number_format

From: Date: Wed, 11 Mar 2015 13:06:05 +0000
Subject: Req #69161 [Asn->Opn]: Removing Signed Zeros - number_format
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191310@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69161&edit=1 ID: 69161 Updated by: demon@php.net Reported by: tom at r dot je Summary: Removing Signed Zeros - number_format -Status: Assigned +Status: Open Type: Feature/Change Request Package: *General Issues Operating System: Linux PHP Version: All -Assigned To: demon +Assigned To: Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2015-03-02 16:01:29] tom at r dot je Description: ------------ It's possible to get a signed zero: <?php echo round(-0.0001, 2); // -0 ?> This is valid according to IEEE 754 so probably shouldn't be changed internally. However, for display purposes, "-0" is needlessly confusing. There's no simple way of removing it. I can call abs($num) but I need an if statement to only call abs($num); when $num is -0. My proposal is that number_format, which is used for display purposes, changes -0 into +0. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69161&edit=1

« previous php.bugs (#191310) next »