mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-25 16:42:27 +00:00
Database float unpack
Better unpacking checks of floats coming back from the database
This commit is contained in:
parent
a2da810690
commit
30fbc6d290
@ -16,7 +16,7 @@ public enum ReprocessStoreChoice {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case STARTNORMAL:
|
case STARTNORMAL:
|
||||||
return "Start normally. No risk of overwriting";
|
return "Start normally. Note risk of overwriting!";
|
||||||
case CONTINUECURRENTFILE:
|
case CONTINUECURRENTFILE:
|
||||||
return "Continue from start of last input file processed";
|
return "Continue from start of last input file processed";
|
||||||
case CONTINUENEXTFILE:
|
case CONTINUENEXTFILE:
|
||||||
|
@ -488,6 +488,15 @@ public class PamTableItem implements Cloneable {
|
|||||||
if (value == null) {
|
if (value == null) {
|
||||||
return Float.NaN;
|
return Float.NaN;
|
||||||
}
|
}
|
||||||
|
if (value instanceof String) {
|
||||||
|
try {
|
||||||
|
double val = Double.valueOf((String) value);
|
||||||
|
return (float) val;
|
||||||
|
}
|
||||||
|
catch (NumberFormatException ex) {
|
||||||
|
return Float.NaN;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (value.getClass() == Double.class) {
|
if (value.getClass() == Double.class) {
|
||||||
double dVal = (Double) value;
|
double dVal = (Double) value;
|
||||||
return (float) dVal;
|
return (float) dVal;
|
||||||
|
Loading…
Reference in New Issue
Block a user