Skip to content

Commit

Permalink
Merge pull request #11 from spacious-team/develop
Browse files Browse the repository at this point in the history
Релиз 2022.2
  • Loading branch information
vananiev authored Feb 1, 2022
2 parents afde399 + 022d9b4 commit 4b40e99
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
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

0 comments on commit 4b40e99

Please sign in to comment.