cryptocom-exchange icon indicating copy to clipboard operation
cryptocom-exchange copied to clipboard

quantity_precision 0 bug?

Open doohun opened this issue 1 year ago • 0 comments

if quantity_precision is 0, 11.76 goes 12 it should be down(floor)

class Pair, round_quantity func

my case was XRP_USDT, python 3.9.13

heplers.py def round_down(value: TP.Union[float, str], precision: int) -> float: """Rounds number to lower precision 0.13 -> 0.1""" # value = float(value) # pwr = 10**precision # return round((value * pwr) / pwr, precision)

    value = float(value)
    pwr = 10 ** precision
    return int(value * pwr) / pwr

doohun avatar Sep 12 '23 11:09 doohun