Skip to content

Commit

Permalink
fixed files form Lang #27
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent 26bd0fe commit a8a661b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ public static Number createNumber(String str) throws NumberFormatException {
if (decPos > -1) {

if (expPos > -1) {
if (expPos < decPos) {
if (expPos < decPos || expPos > str.length()) {
throw new NumberFormatException(str + " is not a valid number.");
}
dec = str.substring(decPos + 1, expPos);
Expand All @@ -486,6 +486,9 @@ public static Number createNumber(String str) throws NumberFormatException {
mant = str.substring(0, decPos);
} else {
if (expPos > -1) {
if (expPos > str.length()) {
throw new NumberFormatException(str + " is not a valid number.");
}
mant = str.substring(0, expPos);
} else {
mant = str;
Expand Down

0 comments on commit a8a661b

Please sign in to comment.