Update sorting of price precision logic
This commit is contained in:
@@ -289,10 +289,11 @@ def price_to_precision(
|
|||||||
ticks = price * (10**ndigits)
|
ticks = price * (10**ndigits)
|
||||||
if rounding_mode == ROUND_UP:
|
if rounding_mode == ROUND_UP:
|
||||||
return ceil(ticks) / (10**ndigits)
|
return ceil(ticks) / (10**ndigits)
|
||||||
if rounding_mode == TRUNCATE:
|
|
||||||
return int(ticks) / (10**ndigits)
|
|
||||||
if rounding_mode == ROUND_DOWN:
|
if rounding_mode == ROUND_DOWN:
|
||||||
return floor(ticks) / (10**ndigits)
|
return floor(ticks) / (10**ndigits)
|
||||||
|
if rounding_mode == TRUNCATE:
|
||||||
|
return int(ticks) / (10**ndigits)
|
||||||
|
|
||||||
raise ValueError(f"Unknown rounding_mode {rounding_mode}")
|
raise ValueError(f"Unknown rounding_mode {rounding_mode}")
|
||||||
raise ValueError(f"Unknown precisionMode {precisionMode}")
|
raise ValueError(f"Unknown precisionMode {precisionMode}")
|
||||||
return price
|
return price
|
||||||
|
|||||||
Reference in New Issue
Block a user