Open
Description
Symfony version(s) affected
7.3
Description
Description
When a big int (still < PHP_INT_MAX) is processed by round(int|float $number)
in NumberToLocalizedStringTransformer, its value is altered (loss of precision).
I.e.: round(760934254250171757) --> 760934254250171776
Affects Symfony 7.3 and before
How to reproduce
Details here : EasyCorp/EasyAdminBundle#6934
Possible Solution
Add a type check at the beginning of the method. Integers don't need to be rounded.
private function round(int|float $number): int|float
{
if (is_int($number)) {
return $number;
}
// ...
}
Additional Context
- PHP_INT_MAX = 9223372036854775807 (on my servers).
- More details about the issue I face Issue with filters and bigint EasyCorp/EasyAdminBundle#6934