List of usage examples for javax.json JsonNumber doubleValue
double doubleValue();
From source file:com.floreantpos.ui.views.payment.SettleTicketDialog.java
private void addCoupon(Ticket ticket, JsonObject jsonObject) { Set<String> keys = jsonObject.keySet(); for (String key : keys) { JsonNumber jsonNumber = jsonObject.getJsonNumber(key); double doubleValue = jsonNumber.doubleValue(); TicketDiscount coupon = new TicketDiscount(); coupon.setName(key);/* ww w. j a v a 2 s . co m*/ coupon.setType(Discount.FIXED_PER_ORDER); coupon.setValue(doubleValue); ticket.addTodiscounts(coupon); } }