Like:
float(1.2345678901235E+19) => string(20) "12345678901234567890"
Can it be done?
(it's for json_decode...)
echo number_format($float,0,'.','');
note: this is for integers, increase 0 for extra fractional digits
This is a good solution if you want to have a maximum number of decimal places. Based on the question, I'd change the above to
echo number_format($float,10,'.','');
giving it a max of 10 decimal places. (Arbitrary, but I'm pretty sure it should be higher than 0).The json value I get is not float, it's a really big integer, like 23453453245324532453253425. But it gets converted to float by json_decode. Will your solution always get me the original json value? :) (it seems to work though for the data I have now)
floats have a limited precision, once your integers are large enough it won't work. should work for approx 14 digits. beyond that it might work, but could be sheer luck.
The value has 17 numbers right now. Do you know when it will stop to precisely convert the float?
You can change the setting in the function call, see my answer.