Implements hook_field_formatter_prepare_view().
function field_test_field_formatter_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $displays) {
foreach ($items as $id => $item) {
// To keep the test non-intrusive, only act on the
// 'field_test_with_prepare_view' formatter.
if ($displays[$id]['type'] == 'field_test_with_prepare_view') {
foreach ($item as $delta => $value) {
// Don't add anything on empty values.
if ($value) {
$items[$id][$delta]['additional_formatter_value'] = $value['value'] + 1;
}
}
}
}
}