You are here

function feeds_tamper_math_validate in Feeds Tamper 7

Same name and namespace in other branches
  1. 6 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 67

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' && empty($settings['flip']) && $settings['value'] == 0) {
    form_set_error('settings][value', t('Cannot divide by zero.'));
  }
}