Flowdock
method

save_rounding_mode

Importance_1
v2_2_9 - Show latest stable - 0 notes - Class: BigDecimal
save_rounding_mode() public

Execute the provided block, but preserve the rounding mode

BigDecimal.save_rounding_mode do
  BigDecimal.mode(BigDecimal::ROUND_MODE, :up)
  puts BigDecimal.mode(BigDecimal::ROUND_MODE)
end

For use with the BigDecimal::ROUND_*

See BigDecimal.mode

Show source
Register or log in to add new notes.