class String
Public Instance Methods
add_commas()
click to toggle source
# File lib/number_name_string.rb, line 32 def add_commas self.reverse.gsub(/(\d{3})(?=\d)/, '\\1,').reverse end
to_comma()
click to toggle source
# File lib/number_name_string.rb, line 28 def to_comma self.to_i.to_comma end
to_i()
click to toggle source
# File lib/number_name_string.rb, line 36 def to_i if self =~ /^\d+$/ old_to_i else NumberNameString[self] end end
Also aliased as: old_to_i