diff --git a/reference/strings/functions/number-format.xml b/reference/strings/functions/number-format.xml index ee6c19be0eab..5220842b2ca2 100644 --- a/reference/strings/functions/number-format.xml +++ b/reference/strings/functions/number-format.xml @@ -39,6 +39,11 @@ Sets the number of decimal digits. If 0, the decimal_separator is omitted from the return value. + As of PHP 8.3.0, when the value is negative, num + is rounded to decimals significant digits before + the decimal point. + Prior to PHP 8.3.0, negative values were ignored and handled the + same as 0. @@ -81,6 +86,12 @@ + + 8.3.0 + + Added handling of negative values for decimals. + + 8.0.0 @@ -137,6 +148,32 @@ $english_format_number = number_format($number, 2, '.', ''); + + A negative value for <parameter>decimals</parameter> + + As of PHP 8.3.0, a negative value for decimals + is used to round the number of significant digits before the decimal + point. + + + +]]> + + &example.outputs; + + + +