I am aware that php float numbers are not accurate and I know solutions like BCMath and GMP. I tested the following code on local WAMP server and another server (that uses Nginx):
$size = 0.0006;
$data = json_encode( array("size" => $size));
var_dump($data);
The output on WAMP:
string '{"size":0.0006}' (length=15)
The output on the other server:
string(31) "{"size":0.00059999999999999995}"
PHP version on both servers is 7.3. Why am I getting the expected result on WAMP and something messed up on my hosting server? Is there any configuration that I can fix?