changeset 9491:d7d22ea8573d

Temporarily: log sinfo meanbedheight formatting
author mschaefer
date Wed, 19 Sep 2018 17:53:53 +0200
parents e44c1a8b0c54
children 10530f1d7dd5
files artifacts/src/main/java/org/dive4elements/river/artifacts/common/AbstractResultType.java artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/SInfoResultType.java
diffstat 2 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/common/AbstractResultType.java	Wed Sep 19 16:21:08 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/common/AbstractResultType.java	Wed Sep 19 17:53:53 2018 +0200
@@ -98,7 +98,7 @@
         return formatter.format(value);
     }
 
-    private NumberFormat getFormatter(final CallContext context) {
+    protected NumberFormat getFormatter(final CallContext context) {
         final CallMeta meta = context.getMeta();
         final Locale locale = Resources.getLocale(meta);
 
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/SInfoResultType.java	Wed Sep 19 16:21:08 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/SInfoResultType.java	Wed Sep 19 17:53:53 2018 +0200
@@ -212,8 +212,15 @@
         @Override
         public String exportValue(final CallContext context, final Object value) {
             final double doubleValue = asDouble(value);
-            log.trace(String.format("meanBedHeight.exportValue value: %f doubleValue: %f formatted to: %s", value, doubleValue,
-                    exportDoubleValue(context, doubleValue)));
+            String rm;
+            try {
+                rm = getFormatter(context).getRoundingMode().toString();
+            }
+            catch (final Exception e) {
+                rm = "?";
+            }
+            log.trace(String.format("meanBedHeight.exportValue roundingmode: %s value: %f doubleValue: %f formatted to: %s",
+                    rm, value, doubleValue, exportDoubleValue(context, doubleValue)));
             return exportDoubleValue(context, doubleValue);
         }
 

http://dive4elements.wald.intevation.org