Class: Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/bblib/core/util/roman.rb,
lib/bblib/core/util/number.rb

Instance Method Summary collapse

Instance Method Details

#spell_outObject



97
98
99
# File 'lib/bblib/core/util/number.rb', line 97

def spell_out
  BBLib.number_spelled_out(self)
end

#to_delimited_s(delim = ',') ⇒ Object

Convert this integer into a string with every three digits separated by a delimiter



93
94
95
# File 'lib/bblib/core/util/number.rb', line 93

def to_delimited_s(delim = ',')
  self.to_s.reverse.gsub(/(\d{3})/, "\\1#{delim}").reverse.uncapsulate(',')
end

#to_romanObject



44
45
46
# File 'lib/bblib/core/util/roman.rb', line 44

def to_roman
  BBLib.to_roman to_i
end