Module: Gricer::BaseHelper
- Defined in:
- app/helpers/gricer/base_helper.rb
Overview
A helper with some basic features for formating Gricer’s data
Instance Method Summary collapse
-
#format_percentage(value) ⇒ Object
Format a value as percentage.
-
#format_seconds(value) ⇒ Object
Format a value of seconds as time range.
Instance Method Details
#format_percentage(value) ⇒ Object
Format a value as percentage
9 10 11 |
# File 'app/helpers/gricer/base_helper.rb', line 9 def format_percentage value '%3.2f %' % (value * 100) end |
#format_seconds(value) ⇒ Object
Format a value of seconds as time range
18 19 20 |
# File 'app/helpers/gricer/base_helper.rb', line 18 def format_seconds value '%02d:%02d:%02d' % [(value/3600).floor,((value/60)%60).floor,(value%60)] end |