Commify numbers
to get comma-formatted numbers.
numbers = "10000000 1.345 -91245555.45 +6788876.224334 -2321232" numbers.reverse! numbers.gsub!(/(\d\d\d)(?=\d)(?!\d*\.)/, '\1,') puts numbers.reverse!
11382 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
numbers = "10000000 1.345 -91245555.45 +6788876.224334 -2321232" numbers.reverse! numbers.gsub!(/(\d\d\d)(?=\d)(?!\d*\.)/, '\1,') puts numbers.reverse!