Method: Faker::Invoice.amount_between

Defined in:
lib/faker/default/invoice.rb

.amount_between(from: 0, to: 0) ⇒ Integer

Produces a random amount between values with 2 decimals

Examples:

Faker::Invoice.amount_between #=> 0
Faker::Invoice.amount_between(from: 0, to: 10) #=> 4.33

Parameters:

  • from (Integer) (defaults to: 0)

    Specifies lower limit.

  • to (Integer) (defaults to: 0)

    Specifies upper limit.

Returns:

  • (Integer)


20
21
22
# File 'lib/faker/default/invoice.rb', line 20

def amount_between(from: 0, to: 0)
  Faker::Base.rand_in_range(from, to).round(2)
end