Posted by albert on 08/20/07 09:03
> Have a look at round()'s second parameter ...
I tried this :
$MyDec = 0.0024096385542168672344587321276776492595672607421875;
$MyDecOk = round($MyDec, 4) ;
The trouble is that this data is serialized in a text file afterward.
Even with round($MyDec, 4), I do get 0.0023999999999... in the text file !
I used the number_format function instead.
albert
Navigation:
[Reply to this message]
|