Why isn't working, i got the error : TypeError: 'float' object cannot be interpreted as an integer
My code
qtyprice = 0.5221932114882507
lot_size = 0.1
quantity = float(round(qtyprice, lot_size))
print (quantity)
My expected result should be 0.5
When i try this way, the result is 0
qtyprice = 0.5221932114882507
lot_size = 0.1
qtyprice = int(qtyprice)
lot_size = int(lot_size)
quantity = float(round(qtyprice, lot_size))
print (quantity)
lot_sizeto 1. The second parameter inroundis how many decimal digits to have, it should be a positive int.number: Required. The number to be rounded-digits: Optional. The number of decimals to use when rounding the number. Default is 0