Although the database contains full coordinates to 6 digits right of the decimal, but using tokens such as [term:field-coordinates:lat] or [term:field-coordinates:lon] outputs to only 2 digits right of the decimal.

Works correctly using Views and OpenLayers, but specifically having an issues with tokens.

Comments

richardbporter’s picture

Did you ever find a workaround for this issue? I've got the same problem.

Schnitzer’s picture

+1

Adam S’s picture

+1 I just ran into this problem. It truncates to the hundredths.

EDIT: Seems that inside entity_token.tokens.inc all decimals are formatted to the hundredths place. I'm just going to circumvent this and write a bunch of custom tokens because there are other problems I'm faced with else where. If I get time, I'll do a proper bug request in Entity API issue queue.

  switch ($wrapper->type()) {
    case 'integer':
      return $wrapper->value();
    case 'decimal':
      return number_format($wrapper->value(), 2);
    case 'date':
      return format_date($wrapper->value(), 'medium', '', NULL, $langcode);
    case 'duration':
      return format_interval($wrapper->value(), 2, $langcode);
    case 'boolean':
      return $wrapper->value() ? t('true') : t('false');
    case 'uri':
    case 'text':
      return $wrapper->value($options;
  }
donutdan4114’s picture