IIM NUR DIANSYAH IIM NUR DIANSYAH - 4 months ago 7
PHP Question

how to change long format number in php?

I want to ask something about number

function
on PHP. How to change
1.7849313424115E+16
format into
17849313424115340
?

My problem is, i use an API and return value is
1.7849313424115E+16
, but i need
17849313424115340
format for another process. i can't change API for output code, so i think i must "convert" the output value. Is it possible to do?

I've tried to use
round()
,
intval()
, etc. but i still not get a clue.Any ideas or suggest? Any help would be appreciate.

Thanks in advance :)

Answer

You can use number_format function for this.

  number_format(1.7849313424115E+16,0,'','')