Skip to content

Commit fb86efb

Browse files
committed
Block Integer parsing of a string if it contains a decimal point.
1 parent 0ff8092 commit fb86efb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/org/scijava/parsington/Literals.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,9 @@ public static Number parseDecimal(final CharSequence s, final Position pos) {
407407
final boolean forceLong = "l".equalsIgnoreCase(force);
408408
final boolean forceFloat = "f".equalsIgnoreCase(force);
409409
final boolean forceDouble = "d".equalsIgnoreCase(force);
410+
final int dot = number.indexOf(".");
410411
Number result = null;
411-
if (!forceFloat && !forceDouble) {
412+
if ((dot == -1) && !forceFloat && !forceDouble) {
412413
result = parseInteger(number, forceLong, 10);
413414
}
414415
if (result == null && !forceLong) {

0 commit comments

Comments
 (0)