if m
val=variation_value(m, options)
if val
- formatted_val=(val>=0 ? "+#{m.format_numeric_value(val)}" : m.format_numeric_value(val))
+ formatted_val=(val>=0 ? "+" : "") + m.format_numeric_value(val, :variation => true)
css_class=''
if options[:color]||true
css_class='var'
end
end
- def format_numeric_value(val)
+ def format_numeric_value(val, options={})
if metric.nil?
return val.to_s
end
when Metric::VALUE_TYPE_FLOAT
number_with_precision(val, :precision => 1)
when Metric::VALUE_TYPE_PERCENT
- number_to_percentage(val, {:precision => 1})
+ if (options[:variation]==true)
+ number_with_precision(val, :precision => 1)
+ else
+ number_to_percentage(val, {:precision => 1})
+ end
when Metric::VALUE_TYPE_MILLISEC
millisecs_formatted_value(val)
else