if(price1 == null) { price1 = 0; } if(price2 == null){ price2 = 0; } if(price3 == null) { price3 = 0; } if(unit!=null&&(unit.trim().equals("KG")||unit.trim().equals("ǧ¿Ë")||unit.trim().equals("kg")||unit.trim().equals("¹«½ï"))) { price1 = price1 / 2; price3 = price3 / 2; price2 = price2 / 2; unit = "500g"; } return ["price1": price1, "price3": price3, "unit":unit, "price2":price2 ]