Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. 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