Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Релиз 2022.2 #11

Merged
merged 2 commits into from
Feb 1, 2022
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