mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-21 22:52:22 +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() {
|
||||
switch (this) {
|
||||
case STARTNORMAL:
|
||||
return "Start normally. No risk of overwriting";
|
||||
return "Start normally. Note risk of overwriting!";
|
||||
case CONTINUECURRENTFILE:
|
||||
return "Continue from start of last input file processed";
|
||||
case CONTINUENEXTFILE:
|
||||
|
@ -488,6 +488,15 @@ public class PamTableItem implements Cloneable {
|
||||
if (value == null) {
|
||||
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) {
|
||||
double dVal = (Double) value;
|
||||
return (float) dVal;
|
||||
|
Loading…
Reference in New Issue
Block a user