How do I add a decimal to my number?

Viewed 8072

I'm doing some calculations and I end up with 65.0 or 43.5.
I need to add a zero to this number so that my number comparison works:

$this->sub_total == $order_sub_total

I've tested using number_format():

$total = number_format($total, 2, '.');

But that gives me er msg: Wrong parameter count for number_format()

I'm tempted to just do:

$total = $total.'0';

But I think that is a bad idea in case the number is 35.43.

So how can I add a extra decimal to my number?

3 Answers
Related