module Splittable

Constants

VERSION

Public Class Methods

division(value:, quantity:, precision: 2) click to toggle source

receive total value and to quantity installments are required to equal division just the first installment will receive the difference cents

# File lib/splittable.rb, line 12
def division(value:, quantity:, precision: 2)
  Splittable::Division.new(value: value, quantity: quantity, precision: precision).call
end
normalize(value:, installments:, precision: 2) click to toggle source

receive total value and specific value of installments are required to specific division just the first installment will receive the difference cents

# File lib/splittable.rb, line 18
def normalize(value:, installments:, precision: 2)
  Splittable::Normalize.new(value: value, installments: installments, precision: precision).call
end