You are here

function theme_feedapi_stat_format in FeedAPI 6

Format a statistical value.

1 theme call to theme_feedapi_stat_format()
theme_feedapi_stat in feedapi_stat/feedapi_stat.module
Theme stats. Accepts result of feedapi_stat_get().

File

feedapi_stat/feedapi_stat.module, line 125
Visualize standard FeedAPI statistics logs.

Code

function theme_feedapi_stat_format($value, $type = '') {
  if (empty($value) && $value !== 0) {
    return '<span class="feedapi-stat na"> - </span>';
  }
  switch ($type) {
    case 'next_refresh_time':
    case 'update_times':
      return '<span class="feedapi-stat date">' . format_date($value, 'custom', 'Y-m-d H:m:s') . '</span>';
    case 'process_time':
      return '<span class="feedapi-stat interval">' . $value / 1000 . '</span>';
    case 'download_num':
    case 'new':
      return '<span class="feedapi-stat number">' . $value . '</span>';
    case 'memory_increase':
      return '<span class="feedapi-stat number">' . number_format($value / (1024 * 1024), 3) . '</span>';
    default:
      return '<span class="feedapi-stat">' . $value . '</span>';
  }
}