EDIT: Converted to using round which returns a float
I am converting am rounding a number to 2 decimals using round function
My question is about this line of code below:
Could their be rounding errors or unexpected behavior that could cause this condition to be true when it should not be?
if ($cc_amount > $total)
FULL CODE:
$cc_amount = round($this->sale_lib->get_payment_total('credit'),2);
$total = round($this->sale_lib->get_total(),2);
//Since they are floats could there be rounding errors?
if ($cc_amount > $total)
{
$this->_reload(array('error' => 'Credit card payment is greater than total');
}