Positions - Quantity Field Discrepancies

gautamsatpathy
In class com.zerodhatech.models.Position, all the Quantity fields are Integers (int), other than dayBuyQuantity and daySellQuantity, which are double. Why? This does not make sense at all. How can a Quantity be a fractional?
    
@SerializedName("day_buy_quantity")
public double dayBuyQuantity;
@SerializedName("day_sell_quantity")
public double daySellQuantity;
  • sujith
    It was a legacy decision. Back in v1 of Kite Connect APIs, buy value and sell value wasn't there. It was calculated in the front end. Now that API is sending those values, it makes sense to change it to quantity.
    We will change it in next release.
  • gautamsatpathy
    Okay. If I understand your comment correctly, the decision to have these values as double is a legacy decision and they will be changed to int in a future release. Is that correct or have I misunderstood your comment?
  • sujith
    It is the client library that had this inference. For API anyways everything is string or a part of json which is sent as string.
This discussion has been closed.