class Units(OAType):
"""representation Units, string value of an integer."""
def __init__(self, units):
self._v = "{:d}".format(int(units))
The library formats the price as integer - e.g. 0.02 gets 0. Unfortunately one Bitcoin is currently worth thousands of Dollars ... this doesn't make any sense.
Solution
This library should support decimal points... So I changed self._v = "{:d}".format(int(units)) to self._v = str(units) ... seems to work ok.
This error occurs e.g. when trading Bitcoin.
Steps to reproduce
The Error
... "rejectReason":"UNITS_INVALID","instrument":"BTC_USD","units":"0" ...
File:types.py
The library formats the price as integer - e.g. 0.02 gets 0. Unfortunately one Bitcoin is currently worth thousands of Dollars ... this doesn't make any sense.
Solution
This library should support decimal points... So I changed
self._v = "{:d}".format(int(units))
toself._v = str(units)
... seems to work ok.