Toys: April 2007 Archives

for apeiros:

class Numeric
  def commify(dec='.', sep=',')
    num = to_s.sub(/\./, dec)
    dec = Regexp.escape dec
    num.reverse.gsub(/(\d\d\d)(?=\d)(?!\d*#{dec})/, "\\1#{sep}").reverse
  end
end

About this Archive

This page is a archive of entries in the Toys category from April 2007.

Toys: March 2007 is the previous archive.

Toys: July 2007 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.1