mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-03 03:15:32 -04:00
Support for float to BigDecimal in optBigDecimal
This commit is contained in:
parent
a8d4e4734f
commit
bd4b180f4e
@ -1020,8 +1020,8 @@ public class JSONObject {
|
||||
if (val instanceof BigInteger){
|
||||
return new BigDecimal((BigInteger) val);
|
||||
}
|
||||
if (val instanceof Double){
|
||||
return new BigDecimal(((Double) val).doubleValue());
|
||||
if (val instanceof Double || val instanceof Float){
|
||||
return new BigDecimal(((Number) val).doubleValue());
|
||||
}
|
||||
if (val instanceof Long || val instanceof Integer
|
||||
|| val instanceof Short || val instanceof Byte){
|
||||
|
Loading…
x
Reference in New Issue
Block a user