You can clone with
def number_with_delimiter(number, delimiter=",", separator=".")
parts = number.to_s.split('.')
why is there a rescue in there... ?
calling number_with_delimeter("") will rise:
NoMethodError: undefined method `gsub!' for nil:NilClass
from (irb):3:in `number_with_delimiter'
from /Users/jpemberthy/.rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in `<main>'
Anyways, I guess that's a programmer's responsibility, probably that rescue is not needed.