Sha256: 8134b44232618c687b50917f662e1ef09b41ae750df0b52ae2b1ccb072dff77d
Contents?: true
Size: 691 Bytes
Versions: 8
Compression:
Stored size: 691 Bytes
Contents
class Numeric def to_currency(pre_symbol='$', thousands=',', decimal='.', post_symbol=nil) #:nodoc: "#{pre_symbol}#{("%.2f" % self ).gsub(/(\d)(?=(?:\d{3})+(?:$|\.))/,"\\1#{thousands}")}#{post_symbol}" end def microseconds() Float(self * (10 ** -6)) end def milliseconds() Float(self * (10 ** -3)) end def seconds() self end def minutes() 60 * seconds end def hours() 60 * minutes end def days() 24 * hours end def weeks() 7 * days end def months() 30 * days end def years() 365 * days end def decades() 10 * years end %w{ microseconds milliseconds seconds minutes hours days weeks months years decades }.each{ |m| mm = m.chop; alias_method mm, m } end
Version data entries
8 entries across 8 versions & 1 rubygems