I'm encoding a JSON file with the following function:
json_encode( $config, JSON_PRETTY_PRINT | JSON_FORCE_OBJECT |
JSON_PRESERVE_ZERO_FRACTION | JSON_NUMERIC_CHECK );
The issue is (or I'm pretty sure is) the JSON_NUMERIC_CHECK flag, is causing floats of 5 decimal places or more to be output like this:
1.0e-7
rather than this:
0.0000001
How can I keep my float values intact when outputting the file?
Very weird behavior as floats with shorter decimal places are being encoded just fine.