You are here

function feeds_tamper_math_validate in Feeds Tamper 6

Same name and namespace in other branches
  1. 7 plugins/math.inc \feeds_tamper_math_validate()
1 string reference to 'feeds_tamper_math_validate'
math.inc in plugins/math.inc

File

plugins/math.inc, line 42

Code

function feeds_tamper_math_validate(&$settings) {
  if (!is_numeric($settings['value'])) {
    form_set_error('settings][value', t('The value must be numeric.'));
  }
  elseif ($settings['operation'] == 'division' && $settings['value'] == 0) {
    form_set_error('settings][value', t('Cannot divide by zero.'));
  }
}