Class: Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/motion-steward/app_store_research.rb

Instance Method Summary collapse

Instance Method Details

#commasObject



5
6
7
8
9
10
11
12
# File 'lib/motion-steward/app_store_research.rb', line 5

def commas
  self            #=> 12345678
    .to_s             #=> "12345678"
    .reverse          #=> "87654321"
    .scan(/\d{1,3}/)  #=> ["876","543","21"]
    .join(",")        #=> "876,543,21"
    .reverse          #=> "12,345,678"
end