def number_with_delimiter(n, delim = ',')
      n.to_i.to_s.reverse.chars.each_slice(3).map(&:join).join(delim).reverse
    end
def number_with_delimiter(n, delim = ',')
      n.to_i.to_s.reverse.chars.each_slice(3).map(&:join).join(delim).reverse
    end
Converts an integer number into a human-readable string with thousands delimiters.
 Example:
   number_with_delimiter(1234567890, ',')
   => 1,234,567,890
 Params:
 +n+ the number to be delimited. Will be converted to an integer
 +delim+ the string to be used as the thousands delimiter. Defaults to ','