Here you can find the source of jsonBigDecimal(JsonValue value)
public static BigDecimal jsonBigDecimal(JsonValue value)
//package com.java2s; import java.math.BigDecimal; import java.text.DecimalFormat; import java.text.NumberFormat; import java.text.ParseException; import javax.json.JsonNumber; import javax.json.JsonString; import javax.json.JsonValue; public class Main { public static BigDecimal jsonBigDecimal(JsonValue value) { if (value == null || value.getValueType() == JsonValue.ValueType.NULL) return null; if (value.getValueType() == JsonValue.ValueType.NUMBER && (value instanceof JsonNumber)) return ((JsonNumber) value).bigDecimalValue(); if (value.getValueType() == JsonValue.ValueType.STRING && (value instanceof JsonString)) { NumberFormat f = NumberFormat.getNumberInstance(); if (f instanceof DecimalFormat) ((DecimalFormat) f).setParseBigDecimal(true); try { return (BigDecimal) f.parseObject(((JsonString) value).getString()); } catch (ParseException ex) { System.out.println(ex.toString()); }//from w ww .j av a2 s .c o m } return null; } }