File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed
Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 212112 r. to_d ( 3 )
22220 i. to_d
2323
24+ BigDecimal ( "1.234" ) . round ( 2 )
25+ BigDecimal ( "1.234" ) . round ( 2 , BigDecimal ::ROUND_UP )
26+ BigDecimal ( "1.234" ) . round ( 2 , :up )
27+
2428require "bigdecimal/math"
2529
2630BigMath . E ( 10 )
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ class BigDecimal < Numeric
192192 # `:ceil`.
193193 # * `ROUND_FLOOR`: Round toward negative infinity. Aliased as `:floor:`.
194194 #
195- def self.mode : (Integer mode, ?Integer? value) -> Integer?
195+ def self.mode : (Integer mode, ?( Integer | Symbol | nil ) value) -> Integer?
196196
197197 # <!--
198198 # rdoc-file=ext/bigdecimal/bigdecimal.c
@@ -854,7 +854,7 @@ class BigDecimal < Numeric
854854 # is performed; see BigDecimal.mode.
855855 #
856856 def round : () -> Integer
857- | (Numeric n, ?Integer mode) -> BigDecimal
857+ | (Numeric n, ?( Integer | Symbol) mode) -> BigDecimal
858858
859859 # <!--
860860 # rdoc-file=ext/bigdecimal/bigdecimal.c
Original file line number Diff line number Diff line change 212112 r. to_d ( 3 )
22220 i. to_d
2323
24+ BigDecimal ( "1.234" ) . round ( 2 )
25+ BigDecimal ( "1.234" ) . round ( 2 , BigDecimal ::ROUND_UP )
26+ BigDecimal ( "1.234" ) . round ( 2 , :up )
27+
2428require "bigdecimal/math"
2529
2630BigMath . E ( 10 )
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ class BigDecimal < Numeric
192192 # `:ceil`.
193193 # * `ROUND_FLOOR`: Round toward negative infinity. Aliased as `:floor:`.
194194 #
195- def self.mode : (Integer mode, ?Integer? value) -> Integer?
195+ def self.mode : (Integer mode, ?( Integer | Symbol | nil ) value) -> Integer?
196196
197197 # <!--
198198 # rdoc-file=ext/bigdecimal/bigdecimal.c
@@ -839,7 +839,7 @@ class BigDecimal < Numeric
839839 # is performed; see BigDecimal.mode.
840840 #
841841 def round : () -> Integer
842- | (Numeric n, ?Integer mode) -> BigDecimal
842+ | (Numeric n, ?( Integer | Symbol) mode) -> BigDecimal
843843
844844 # <!--
845845 # rdoc-file=ext/bigdecimal/bigdecimal.c
You can’t perform that action at this time.
0 commit comments