diff artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java @ 7047:b5e9b8b5c8d6

issue1493: Use other numberformat for csv data from diagram.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 19 Sep 2013 09:16:52 +0200
parents 5eb8b9ae4484
children 3a0522f1a532
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java	Wed Sep 18 18:40:52 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java	Thu Sep 19 09:16:52 2013 +0200
@@ -99,6 +99,10 @@
     public static final int SQ_RELATION_B_MAX_DIGITS  = 3;
     public static final int SQ_RELATION_B_MIN_DIGITS  = 3;
 
+    // OTHER
+    public static final int CSV_DIAGRAM_DATA_MAX_DIGITS  = 3;
+    public static final int CSV_DIAGRAM_DATA_MIN_DIGITS  = 3;
+
     /**
      * Creates a localized NumberFormatter with given range of decimal digits.
      * @param m CallMeta to find the locale.
@@ -191,6 +195,18 @@
                 WATERLEVEL_KM_MAX_DIGITS);
     }
 
+    /**
+     * Returns the number formatter for data exported from diagram (not from
+     * calculation.
+     *
+     * @return the number formatter for csv data from diagra.
+     */
+    public static NumberFormat getCSVFormatter(CallContext context) {
+        return getFormatter(
+                context,
+                CSV_DIAGRAM_DATA_MIN_DIGITS,
+                CSV_DIAGRAM_DATA_MAX_DIGITS);
+    }
 
     public static NumberFormat getWaterlevelW(CallMeta meta) {
         return getFormatter(

http://dive4elements.wald.intevation.org