ar_to_html_table 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +4 -0
- data/lib/ar_to_html_table/column_formatter.rb +8 -3
- data/lib/ar_to_html_table/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG
CHANGED
@@ -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
|
282
|
+
bar = (val > MIN_PERCENT_BAR_VALUE) ? "<div class=\"hbar\" style=\"width:#{width}%\"> </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
|
289
|
-
when 80..
|
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
|
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:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 9
|
10
|
+
version: 0.1.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kip Cole
|