diff --git a/pom.xml b/pom.xml index 6bced84..21b2823 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ 6.0.0 5.0.0 0.4.1 - 4.1.5 + 4.3.6 1.7.25 diff --git a/pris-xls/src/main/java/org/opennms/plugins/pris/xls/XlsSource.java b/pris-xls/src/main/java/org/opennms/plugins/pris/xls/XlsSource.java index 402e10a..8971a66 100644 --- a/pris-xls/src/main/java/org/opennms/plugins/pris/xls/XlsSource.java +++ b/pris-xls/src/main/java/org/opennms/plugins/pris/xls/XlsSource.java @@ -80,8 +80,16 @@ public class XlsSource implements Source { public static String getStringValueFromCell(Cell cell) { String value = null; switch (cell.getCellTypeEnum()) { - case NUMERIC: value = Integer.toString((int)cell.getNumericCellValue()); + case NUMERIC: + double d = cell.getNumericCellValue(); + if (d % 1 ==0) { + value = Integer.toString((int) d); + } else { + // prints double with 7 decimal places - suitable for lat/long + value = String.format("%.7f",d); + } break; + case STRING: value = cell.getStringCellValue(); break; case BOOLEAN: value = ((Boolean) cell.getBooleanCellValue()).toString();