Parent

Forgery::Monetary

Public Class Methods

formatted_money(options={}) click to toggle source
# File lib/forgery/forgery/monetary.rb, line 3
def self.formatted_money(options={})
  "$%1.2f" % money(options)
end
money(options={}) click to toggle source
# File lib/forgery/forgery/monetary.rb, line 7
def self.money(options={})
  options = {:max => 10,
             :min => 0}.merge(options)

  value = Forgery::Extend((options[:min] * 100)..(options[:max] * 100)).random
  "%1.2f" % (value.to_f / 100)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.