金額3桁区切り

def num_fmt(num)
  num.to_s.reverse.gsub( /(\d{3})(?=\d)/, '\1,' ).reverse
end

print num_fmt(12344565890),"\n"
print num_fmt(1234456589),"\n"
print num_fmt(123445658),"\n"

参考URL
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/37580