You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The v20.Context class accepts a constructor parameter decimal_number_as_float=True
This flag is used in the Context.convert_decimal_number method, used by everything else to parse rational numbers returned in the API responses. By default it converts these all from strings to the native float type allowing arithmetic etc..
However, I would like the Python Decimal class to be used as it can guarantee exact precision when performing arithmetic.
One way to get around this is to sub-class the Context, e.g.
The
v20.Context
class accepts a constructor parameterdecimal_number_as_float=True
This flag is used in the
Context.convert_decimal_number
method, used by everything else to parse rational numbers returned in the API responses. By default it converts these all from strings to the nativefloat
type allowing arithmetic etc..However, I would like the Python
Decimal
class to be used as it can guarantee exact precision when performing arithmetic.One way to get around this is to sub-class the Context, e.g.
References:
The text was updated successfully, but these errors were encountered: