Module: TempestTime::Helpers::FormattingHelper

Included in:
JiraAPI::Models::Issue, Models::Report
Defined in:
lib/tempest_time/helpers/formatting_helper.rb

Instance Method Summary collapse

Instance Method Details

#braced(text, length = text.length) ⇒ Object



4
5
6
7
8
9
# File 'lib/tempest_time/helpers/formatting_helper.rb', line 4

def braced(text, length = text.length)
  padding_amount = length - text.length
  front_padding = ' ' * (padding_amount / 2.0).ceil
  back_padding = ' ' * (padding_amount / 2.0).floor
  '[' + front_padding + text + back_padding + ']'
end

#with_percent_sign(decimal) ⇒ Object



11
12
13
# File 'lib/tempest_time/helpers/formatting_helper.rb', line 11

def with_percent_sign(decimal)
  "#{(decimal * 100).to_i}%"
end