simple decimals in Neon produce very long decimals in PHP
- petr.pavel
- Member | 535
I noticed that generated Configurator files contain different numbers on my
dev station and on the server.
Anyone has any idea about why?
dryDiscount:
basic: 0.025 # 2.5%
handicap:
# if flight min is -39.9 then all HF between -40.0 and -49.0 will be trimmed to -39.9
trimmingBracket: 9.1
server:
'dryDiscount' => [
'basic' => 0.025000000000000001387778780781445675529539585113525390625,
],
'handicap' => ['trimmingBracket' => 9.0999999999999996447286321199499070644378662109375],
dev machine:
'dryDiscount' => [
'basic' => 0.025,
],
'handicap' => ['trimmingBracket' => 9.1],
- petr.pavel
- Member | 535
Thank you!
Both servers are running PHP 8.1 however:
dev | live server | |
---|---|---|
serialize_precision | –1 | 100 |
precision | 14 | 14 |
It turned out that even though default value for PHP 8.1 is –1, WHM/cPanel sets it to 100.