diff artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java @ 9503:83e6acdf8fc6

Fixed: no rounding during calculations (Meilenstein-2 2.9)
author mschaefer
date Fri, 28 Sep 2018 10:11:06 +0200
parents fd6621f47a72
children b9c87bbff6a4
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java	Fri Sep 28 10:02:28 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java	Fri Sep 28 10:11:06 2018 +0200
@@ -8,8 +8,6 @@
 
 package org.dive4elements.river.utils;
 
-import java.math.BigDecimal;
-import java.math.RoundingMode;
 import java.text.DateFormat;
 import java.text.DecimalFormat;
 import java.text.NumberFormat;
@@ -385,27 +383,11 @@
         return Formatter.getFormatter(context, FLOWDEPTH_MAX_DIGITS, FLOWDEPTH_MAX_DIGITS);
     }
 
-    /**
-     * Decimal half even rounding of a flow depth value
-     * (ATTENTION: throws an exception for NaN or Infinity!)
-     */
-    public static BigDecimal roundFlowDepth(final double value) {
-        return BigDecimal.valueOf(value).setScale(FLOWDEPTH_MAX_DIGITS, RoundingMode.HALF_EVEN);
-    }
-
     public static NumberFormat getW(final CallContext context) {
         return Formatter.getFormatter(context, 2, 2);
     }
 
     /**
-     * Decimal half even rounding of a W value
-     * (ATTENTION: throws an exception for NaN or Infinity!)
-     */
-    public static BigDecimal roundW(final double value) {
-        return BigDecimal.valueOf(value).setScale(WATERLEVEL_W_MAX_DIGITS, RoundingMode.HALF_EVEN);
-    }
-
-    /**
      * Another waterlevel formatter with fixed digits (always 2)
      */
     public static NumberFormat getWaterlevelW2(final CallMeta meta) {

http://dive4elements.wald.intevation.org