Update to do Builtin Precise math
This commit is contained in:
parent
a793cf8f05
commit
c8e0fc926d
@ -707,9 +707,9 @@ class Exchange:
|
|||||||
if self.precisionMode == TICK_SIZE:
|
if self.precisionMode == TICK_SIZE:
|
||||||
precision = Precise(str(self.markets[pair]['precision']['price']))
|
precision = Precise(str(self.markets[pair]['precision']['price']))
|
||||||
price_str = Precise(str(price))
|
price_str = Precise(str(price))
|
||||||
missing = price_str.mod(precision)
|
missing = price_str % precision
|
||||||
if not missing.equals(Precise("0")):
|
if not missing == Precise("0"):
|
||||||
price = round(float(str(price_str.sub(missing).add(precision))), 14)
|
price = round(float(str(price_str - missing + precision)), 14)
|
||||||
else:
|
else:
|
||||||
symbol_prec = self.markets[pair]['precision']['price']
|
symbol_prec = self.markets[pair]['precision']['price']
|
||||||
big_price = price * pow(10, symbol_prec)
|
big_price = price * pow(10, symbol_prec)
|
||||||
|
Loading…
Reference in New Issue
Block a user