Example usage for javax.json JsonNumber doubleValue

List of usage examples for javax.json JsonNumber doubleValue

Introduction

In this page you can find the example usage for javax.json JsonNumber doubleValue.

Prototype

double doubleValue();

Source Link

Document

Returns this JSON number as a double .

Usage

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);
    }
}