You probably want to use sprintf:
$foo = 1100.64686081907; $bar = sprintf("%.2f", $foo);
Now $bar will contain 1100.65
Update: changed variable names from $a, $b to $foo, $bar for the first are "special" globals (thanks for the warning, davido)
In reply to Re: Simple Rounding
by b10m
in thread Simple Rounding
by einerwitzen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |