Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

BigDecimal.limit

BigDecimal.limit(digits)
Limit the number of significant digits in newly created BigDecimal
numbers to the specified value. Rounding is performed as necessary,
as specified by BigDecimal.mode.
A limit of 0, the default, means no upper limit.
The limit specified by this method takes less priority over any limit
specified to instance methods such as ceil, floor, truncate, or round.
No documentation available