Revision: 16036
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at July 23, 2009 22:29 by gatement
Initial Code
def number_with_delimiter(number, delimiter=",") number.to_s.gsub(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1#{delimiter}") end a=1024 p number_with_delimiter(a)
Initial URL
Initial Description
Format an integer with commas to make it more readable
Initial Title
Format an integer with commas
Initial Tags
Initial Language
Ruby