You are here

function units_operator_divide_evaluate in Units of Measurement 7.2

1 string reference to 'units_operator_divide_evaluate'
divide.inc in plugins/operator/divide.inc

File

plugins/operator/divide.inc, line 24

Code

function units_operator_divide_evaluate($operand1, $operand2) {
  if (floatval($operand2) == 0) {
    throw new UnitsMathematicalExpressionMalformedException(t('Division by zero.'));
  }
  return $operand1 / $operand2;
}