You are here

function mathfield_mathfield_get_token_value_number_alter in Math Field 7

Implements hook_mathfield_get_token_value_MODULE_alter() for the number.module.

Related topics

File

./mathfield.module, line 705
Adds a dynamic math expression field.

Code

function mathfield_mathfield_get_token_value_number_alter(&$value, $context) {
  $values = $context['form_state']['values'];
  $field_name = $context['field_name'];
  $language = $context['element']['#language'];
  $delta = $context['delta'];
  $column = $context['column'];
  if (isset($values[$field_name][$language][$delta][$column]) && is_numeric($values[$field_name][$language][$delta][$column])) {
    $value = $values[$field_name][$language][$delta][$column];
  }
}