to get around this, # temporarily set a new precision up to the max number of sig figs of # `full_decimal`, which is also the max for the result of `quantize`. # this ensures that the result of `quantize` will be within the precision # limit, and not raise the error. with ...
if result has more places than that.ifexponent < -MAX_DECIMAL_PLACES:# quantize can raise `decimal.InvalidOperation` if result is greater# than context precision, which is 28 by default. to get around this,# temporarily set a new precision up to the max number of sig figs of# `full_de...