views:

21

answers:

2

Hi,

PHP converts a large number to floating point which I need in "long" format to pass to a soap xml api.

((round(time()/(60*15))*60*15)+(30*60))*1000

This gives the result:

1.28E+12

Whereas, what I need is:

"1280495700000"

in order to pass to the api

+2  A: 

format it using number_format()

http://php.net/manual/en/function.number-format.php

Scott M.
This works perfectly! Wow - php is awesome! SO is SO! :)
DrMHC
+1  A: 

This could work:

sprintf('%u',$number);

But if you're about to lose precision you need, look at the BCMath functions (bcadd, bcdiv and the like). They will keep precision, and give you back strings.

Wrikken