Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-server
Commits
b0dd52f3
Commit
b0dd52f3
authored
6 years ago
by
Daniel
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Server parses `nan` to Double in all upper/lowercase variations
parent
aa2f93ae
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/caosdb/server/datatype/DoubleDatatype.java
+6
-1
6 additions, 1 deletion
src/main/java/caosdb/server/datatype/DoubleDatatype.java
with
6 additions
and
1 deletion
src/main/java/caosdb/server/datatype/DoubleDatatype.java
+
6
−
1
View file @
b0dd52f3
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
*
*
* ** end header
* ** end header
*/
*/
// Copyright (c) 2019 Daniel Hornung
package
caosdb.server.datatype
;
package
caosdb.server.datatype
;
import
caosdb.server.entity.Message
;
import
caosdb.server.entity.Message
;
...
@@ -34,7 +35,11 @@ public class DoubleDatatype extends AbstractDatatype {
...
@@ -34,7 +35,11 @@ public class DoubleDatatype extends AbstractDatatype {
if
(
value
instanceof
GenericValue
)
{
if
(
value
instanceof
GenericValue
)
{
return
new
GenericValue
(
Double
.
parseDouble
(((
GenericValue
)
value
).
toDatabaseString
()));
return
new
GenericValue
(
Double
.
parseDouble
(((
GenericValue
)
value
).
toDatabaseString
()));
}
else
{
}
else
{
return
new
GenericValue
(
Double
.
parseDouble
(
value
.
toString
()));
String
valueStr
=
value
.
toString
();
if
(
valueStr
.
toLowerCase
().
equals
(
"nan"
))
{
valueStr
=
"NaN"
;
}
return
new
GenericValue
(
Double
.
parseDouble
(
valueStr
));
}
}
}
catch
(
final
NumberFormatException
e
)
{
}
catch
(
final
NumberFormatException
e
)
{
throw
ServerMessages
.
CANNOT_PARSE_DOUBLE_VALUE
;
throw
ServerMessages
.
CANNOT_PARSE_DOUBLE_VALUE
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment