Hi,
Here's and example :-
$cost=3.000; $count=10;
$result=($cost/$count); $roundedresult=round($result,3);
When I print the result, I want the following:-
0.300
What I get back is:-
0.3
Is there any way to do this?
Thanks,
Stuart
Use formatted printing: printf("%.3f", $a);
This prints a FLOAT (%f) with three digits after the decimanl point (.3)
Thanks, it's work great!
printf("%.3f", $roundedresult);