Posted by Michael Fesser on 08/18/07 15:32
..oO(albert)
>Doing a simple division, I obtain this number :
>0.0024096385542168672344587321276776492595672607421875
>I'd like to have 0.0024 instead.
>I know the number_format function but is it the right solution ?
>I thought of another solution :
>
>$MyDec = 0.0024096385542168672344587321276776492595672607421875;
>$MyDecOk = round($MyDec * 10000) / 10000 ; # => 0.0024
>
>Is there a special function to do so ?
Have a look at round()'s second parameter ...
Micha
Navigation:
[Reply to this message]
|