tweety tweety - 1 year ago 135
PHP Question

Convert float to string in php?


float(1.2345678901235E+19) => string(20) "12345678901234567890"

Can it be done?

(it's for json_decode...)

Answer Source
echo number_format($float,0,'.','');

note: this is for integers, increase 0 for extra fractional digits

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download