Switching this to use the python built-in format instead of using str with quantize. In certain cases (which I'm not entirely sure) this returns a "InvalidOperation: quantize result has too many digits for current context".
Switched to using python's built-in format function. This avoids context errors when trying to use decimals quantize and str(). In certain cases this will throw a "InvalidOperation: quantize result has too many digits for current context" error.