Module: HasAccounts::CoreExtensions::BigDecimal::Rounding

Included in:
BigDecimal
Defined in:
lib/has_accounts/core_ext/rounding.rb

Instance Method Summary collapse

Instance Method Details

#currency_roundObject


21
22
23
24
25
26
27
# File 'lib/has_accounts/core_ext/rounding.rb', line 21

def currency_round
  if self.nil?
    return BigDecimal.new('0')
  else
    return (self * 20).round / BigDecimal('20')
  end
end