ar_to_html_table 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ ar_to_html_table (0.1.9) October 24, 2010
2
+
3
+ * Bar and percentage fixes for when % > 100
4
+
1
5
  ar_to_html_table (0.1.8) October 24, 2010
2
6
 
3
7
  * Formatter seconds_to_time now omits the hours if the time is less than one hour.
@@ -75,6 +75,9 @@ module ArToHtmlTable
75
75
  # # Given a value of 3600, the formatter will output
76
76
  # => 05:00
77
77
  #
78
+ # # Given a value of 3600, the formatter will output
79
+ # => 05:00
80
+ #
78
81
  # val: the value to be formatted
79
82
  # options: formatter options
80
83
  def seconds_to_time(val, options)
@@ -274,8 +277,9 @@ module ArToHtmlTable
274
277
  # options: formatter options
275
278
  def bar_and_percentage(val, options)
276
279
  if options[:cell_type] == :td
280
+ val = val.to_f
277
281
  width = val * bar_reduction_factor(val)
278
- bar = (val.to_f > MIN_PERCENT_BAR_VALUE) ? "<div class=\"hbar\" style=\"width:#{width}%\">&nbsp;</div>" : ''
282
+ bar = (val > MIN_PERCENT_BAR_VALUE) ? "<div class=\"hbar\" style=\"width:#{width}%\">&nbsp;</div>" : ''
279
283
  bar + "<div>" + percentage(val, :precision => 1) + "</div>"
280
284
  else
281
285
  percentage(val, :precision => 1)
@@ -285,8 +289,9 @@ module ArToHtmlTable
285
289
  private
286
290
  def bar_reduction_factor(value)
287
291
  case value
288
- when 0..79 then REDUCTION_FACTOR
289
- when 80..99 then 0.6
292
+ when 0..79 then REDUCTION_FACTOR
293
+ when 80..100 then 0.7
294
+ when 100.1000 then 0.6
290
295
  else 0.3
291
296
  end
292
297
  end
@@ -1,3 +1,3 @@
1
1
  module ArToHtmlTable
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ar_to_html_table
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 8
10
- version: 0.1.8
9
+ - 9
10
+ version: 0.1.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kip Cole