Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<groupId>org.spacious-team</groupId>
<artifactId>table-wrapper-api</artifactId>
<version>2021.6.1</version>
<version>2022.2</version>
<packaging>jar</packaging>

<name>Table Wrapper API</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,17 @@ default double getDoubleValue(C cell) {
if (value instanceof Number) {
return ((Number) value).doubleValue();
} else if (value != null) {
return Double.parseDouble(spacePattern.matcher((CharSequence) value).replaceAll(""));
String str = spacePattern.matcher((CharSequence) value).replaceAll("");
try {
return Double.parseDouble(str);
} catch (NumberFormatException e) {
if (str.indexOf(',') != -1) {
return Double.parseDouble(str.replace(',', '.'));
} else if (str.indexOf('.') != -1) {
return Double.parseDouble(str.replace('.', ','));
}
throw e;
}
} else {
throw new NullPointerException(NO_CELL_VALUE_EXCEPTION_MESSAGE);
}
Expand Down