The BigDecimal constructor takes an optional second parameter, which sets the precision digits of the object. from ruby-doc :
new (initial, digital)
The number of significant digits is like Fixnum. If omitted or 0, the number of significant digits is determined from the initial value.
However, when working with a string, this behavior does not match the description.
BigDecimal.new('1.2345', 4).to_s('F')
How to specify precision using BigDecimal when working with the String parameter?
source share