You are here

function _webform_submit_number in Webform 7.3

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

Implements _webform_submit_component().

File

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

Code

function _webform_submit_number($component, $value) {

  // Because _webform_validate_number() ensures the format matches when moving
  // forward through a form, this should always pass before saving into the
  // database. When moving backwards in a form, do not adjust the value, since
  // it has not yet been validated.
  if (webform_number_format_match($value, $component['extra']['point'], $component['extra']['separator'])) {
    $value = webform_number_standardize($value, $component['extra']['point']);
  }
  return $value;
}