You are here

function webform_modulo in Webform 6.3

Same name and namespace in other branches
  1. 7.4 components/number.inc \webform_modulo()
  2. 7.3 components/number.inc \webform_modulo()

Custom modulo function that properly handles float division.

See https://drupal.org/node/1601968.

1 call to webform_modulo()
_webform_validate_number in components/number.inc
A Drupal Form API Validation function. Validates the entered values from number components on the client-side form.

File

components/number.inc, line 827
Webform module number component.

Code

function webform_modulo($a, $b) {
  return $a - $b * ($b < 0 ? ceil($a / $b) : floor($a / $b));
}