Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,19 @@ public void checkLeadinZero() throws ParseException {
protected Number extractFloat() throws ParseException {
if (!acceptLeadinZero)
checkLeadinZero();
if (!useHiPrecisionFloat)
return Float.parseFloat(xs);
if (xs.length() > 18) // follow JSonIJ parsing method
return new BigDecimal(xs);
return Double.parseDouble(xs);

try {
if (!useHiPrecisionFloat)
return Float.parseFloat(xs);

if (xs.length() > 18) // follow JSonIJ parsing method
return new BigDecimal(xs);

return Double.parseDouble(xs);

} catch(NumberFormatException e){
throw new ParseException(pos, ERROR_UNEXPECTED_TOKEN, xs);
}
}

/**
Expand Down