Skip to content

Commit

Permalink
Make .save_rounding_mode docs bit clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
Sija committed Nov 29, 2018
1 parent fbd4b32 commit a75179f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/big/big_decimal.cr
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,14 @@ struct BigDecimal < Number
# Executes the provided block, preserving the rounding mode:
#
# ```
# BigDecimal.rounding_mode = :half_even
#
# BigDecimal.save_rounding_mode do
# BigDecimal.rounding_mode = :up
# BigDecimal.rounding_mode # => BigDecimal::RoundingMode::UP
# end
#
# BigDecimal.rounding_mode # => BigDecimal::RoundingMode::HALF_UP
# BigDecimal.rounding_mode # => BigDecimal::RoundingMode::HALF_EVEN
# ```
def self.save_rounding_mode
prev_rounding_mode = @@rounding_mode
Expand Down

0 comments on commit a75179f

Please sign in to comment.