def decimal_fmt(num, suffix='sec'):
  """A decimal pretty-printer."""
  if num == 0.0:
    return '0 %s' % suffix
  if num < 1.0:
    for unit in ['', 'm', 'u', 'n', 'p', 'f', 'a', 'z']:
      if abs(num) >= 1.0:
        return '%.3g %s%s' % (num, unit, suffix)
      num *= 1000.0
    return '%.3g %s%s' % (num, 'y', suffix)
  for unit in ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z']:
    if abs(num) < 1000.0:
      return '%.3g %s%s' % (num, unit, suffix)
    num /= 1000.0
  return '%.3g %s%s' % (num, 'Y', suffix)