number_format() Support rounding negative places

From: Date: Fri, 23 Jun 2023 07:53:34 +0000
Subject: number_format() Support rounding negative places
Groups: php.internals 
Request: Send a blank email to internals+get-120668@lists.php.net to get a copy of this message
Hi internals, I have opened a very small PR at https://github.com/php/php-src/pull/11487 I was told to send an email here and ask for feedback. This PR adds support for rounding negative |$decimals| in |number_format()|. Previously negative |$decimals| got silently ignored and the number got rounded to zero decimal places. With this change, when |$decimals| is negative, |$num| is rounded to |$decimals| significant digits before the decimal point. This is matching the behavior for the |$precision| argument of |round()|. The previous behavior wasn't documented or tested at all. if there are no objections, Ilija has agreed to merge this for master. We will of course document this accordingly. Thanks, Marc

Attachment: [application/pgp-keys] OpenPGP public key OpenPGP_0x3936ABF753BC88CE.asc
Attachment: [application/pgp-signature] OpenPGP digital signature OpenPGP_signature.asc
« previous php.internals (#120668) next »