[php-src] PR #11584: number_format: No precesion loss on formatting int's
| From: | marc-mabe | Date: | Mon, 03 Jul 2023 21:01:46 +0000 |
| Subject: | [php-src] PR #11584: number_format: No precesion loss on formatting int's | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-22885@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/11584
Author: marc-mabe
This is based on https://github.com/php/php-src/pull/11487
supporting negative decimal places on
number_format.
* Passing an int to number_format will perform formatting the int
(zend_long) value without casting it to float (double)
* With negative decimal places it will perform rounding (see #11487) in manual way to be able to
round high numbers without integer overflow (e.g. 9223372036854775806 ->
10,000,000,000,000,000,000)
_PS: I'm not a C developer and this is the first time for me handling pointers and malloc ...
please review carefully that I haven't done a mistake ending up in crashes :)_