Module: Opensteam::Money::Rounding
- Included in:
- Tax::Calculation
- Defined in:
- lib/opensteam/money.rb
Instance Method Summary collapse
-
#round(f) ⇒ Object
normal rounding.
-
#round_rappen(f) ⇒ Object
rappen rounding (for CH).
Instance Method Details
#round(f) ⇒ Object
normal rounding
48 49 50 |
# File 'lib/opensteam/money.rb', line 48 def round f BigDecimal.new( f.to_s ).round(2) end |
#round_rappen(f) ⇒ Object
rappen rounding (for CH)
54 55 56 |
# File 'lib/opensteam/money.rb', line 54 def round_rappen f ( BigDecimal.new( f.to_s ) * 20 ).round / 20 end |