diff artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java @ 6322:8c976bb0362f

Add SQ Relation KM formatter and use it fopr issue 1071
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 13 Jun 2013 09:22:46 +0200
parents a82a724356f0
children c6c3a2a26a33
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java	Thu Jun 13 09:09:56 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java	Thu Jun 13 09:22:46 2013 +0200
@@ -92,10 +92,12 @@
     public static final int VARIANCE_MAX_DIGITS = 3;
 
     // SQ Relation
-    public static final int SQ_RELATION_A_MAX_DIGITS = 7;
-    public static final int SQ_RELATION_A_MIN_DIGITS = 7;
-    public static final int SQ_RELATION_B_MAX_DIGITS = 3;
-    public static final int SQ_RELATION_B_MIN_DIGITS = 3;
+    public static final int SQ_RELATION_KM_MIN_DIGITS = 2;
+    public static final int SQ_RELATION_KM_MAX_DIGITS = 2;
+    public static final int SQ_RELATION_A_MAX_DIGITS  = 7;
+    public static final int SQ_RELATION_A_MIN_DIGITS  = 7;
+    public static final int SQ_RELATION_B_MAX_DIGITS  = 3;
+    public static final int SQ_RELATION_B_MIN_DIGITS  = 3;
 
     /**
      * Creates a localized NumberFormatter with given range of decimal digits.
@@ -453,6 +455,13 @@
                 SQ_RELATION_B_MAX_DIGITS);
     }
 
+    public static NumberFormat getSQRelationKM(CallContext context) {
+        return getFormatter(
+                context,
+                SQ_RELATION_KM_MIN_DIGITS,
+                SQ_RELATION_KM_MAX_DIGITS);
+    }
+
     public static NumberFormat getMeterFormat(CallContext context) {
         return getFormatter(
                 context,

http://dive4elements.wald.intevation.org