diff options
author | BurdetteLamar <BurdetteLamar@Yahoo.com> | 2021-11-23 13:26:14 -0600 |
---|---|---|
committer | Kenta Murata <mrkn@mrkn.jp> | 2021-12-24 02:28:57 +0900 |
commit | a8243d07e16cea77dfc9cd323e7cbf8ba478f127 (patch) | |
tree | 69dad97b74991fccecbccc7910c03a856a2f92aa | |
parent | de5c14d4d8e5587efceb15f8df416c9d7f3ee216 (diff) | |
download | ruby-a8243d07e16cea77dfc9cd323e7cbf8ba478f127.tar.gz |
[ruby/bigdecimal] Set rounding mode in example
https://github.com/ruby/bigdecimal/commit/42c999f728
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 0157ef537d..6c845fcda9 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -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 |