I'm trying to add an double value to an JSONObject, its automatically recognising as int(code below). After jsonObject.put the unitCost is converted to integer automatically to {"unitCost":100} rather than {"unitCost":100.0}. Please help i need to keep it as double.Thanks
Double unitCost = 100.0D;
JSONObject jsonObject = new JSONObject();
jsonObject.put("unitCost", unitCost);