Lets take a variable holding a number with decimals:
$number = 21.25116;
Now want to round this number to 3 decimal.
So:
$number = round($number,3);
echo $number;
The result will be something like: 21.251
If $number = 21.2569
then result will be: 21.257
If $number = 21.259652;
Then result will be: 21.26
ANL
No comments:
Post a Comment