Module: MudratProjector::BankerRounding

Included in:
Projector
Defined in:
lib/mudrat_projector/banker_rounding.rb

Instance Method Summary collapse

Instance Method Details

#with_banker_roundingObject



3
4
5
6
7
8
9
# File 'lib/mudrat_projector/banker_rounding.rb', line 3

def with_banker_rounding
  old_rounding_mode = BigDecimal.mode BigDecimal::ROUND_MODE
  BigDecimal.mode BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_EVEN
  yield
ensure
  BigDecimal.mode BigDecimal::ROUND_MODE, old_rounding_mode
end