[ruby/bigdecimal] Set rounding mode in example

https://github.com/ruby/bigdecimal/commit/42c999f728
This commit is contained in:
BurdetteLamar 2021-11-23 13:26:14 -06:00 committed by Kenta Murata
parent de5c14d4d8
commit a8243d07e1
No known key found for this signature in database
GPG Key ID: CEFE8AFB6081B062

View File

@ -1891,6 +1891,8 @@ BigDecimal_div3(int argc, VALUE *argv, VALUE self)
*
* Examples:
*
* # Set the rounding mode.
* BigDecimal.mode(BigDecimal::ROUND_MODE, BigDecimal::ROUND_HALF_UP)
* BigDecimal('111111.111').add(1, 0) # => 0.111112111e6
* BigDecimal('111111.111').add(1, 2) # => 0.11e6
* BigDecimal('111111.111').add(1, 3) # => 0.111e6