comparison 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
comparison
equal deleted inserted replaced
7046:50b9959330de 7047:b5e9b8b5c8d6
97 public static final int SQ_RELATION_A_MAX_DIGITS = 2; 97 public static final int SQ_RELATION_A_MAX_DIGITS = 2;
98 public static final int SQ_RELATION_A_MIN_DIGITS = 2; 98 public static final int SQ_RELATION_A_MIN_DIGITS = 2;
99 public static final int SQ_RELATION_B_MAX_DIGITS = 3; 99 public static final int SQ_RELATION_B_MAX_DIGITS = 3;
100 public static final int SQ_RELATION_B_MIN_DIGITS = 3; 100 public static final int SQ_RELATION_B_MIN_DIGITS = 3;
101 101
102 // OTHER
103 public static final int CSV_DIAGRAM_DATA_MAX_DIGITS = 3;
104 public static final int CSV_DIAGRAM_DATA_MIN_DIGITS = 3;
105
102 /** 106 /**
103 * Creates a localized NumberFormatter with given range of decimal digits. 107 * Creates a localized NumberFormatter with given range of decimal digits.
104 * @param m CallMeta to find the locale. 108 * @param m CallMeta to find the locale.
105 * @param min minimum number of decimal ("fraction") digits. 109 * @param min minimum number of decimal ("fraction") digits.
106 * @param max maximum number of decimal ("fraction") digits. 110 * @param max maximum number of decimal ("fraction") digits.
189 context, 193 context,
190 WATERLEVEL_KM_MIN_DIGITS, 194 WATERLEVEL_KM_MIN_DIGITS,
191 WATERLEVEL_KM_MAX_DIGITS); 195 WATERLEVEL_KM_MAX_DIGITS);
192 } 196 }
193 197
198 /**
199 * Returns the number formatter for data exported from diagram (not from
200 * calculation.
201 *
202 * @return the number formatter for csv data from diagra.
203 */
204 public static NumberFormat getCSVFormatter(CallContext context) {
205 return getFormatter(
206 context,
207 CSV_DIAGRAM_DATA_MIN_DIGITS,
208 CSV_DIAGRAM_DATA_MAX_DIGITS);
209 }
194 210
195 public static NumberFormat getWaterlevelW(CallMeta meta) { 211 public static NumberFormat getWaterlevelW(CallMeta meta) {
196 return getFormatter( 212 return getFormatter(
197 meta, 213 meta,
198 WATERLEVEL_W_MIN_DIGITS, 214 WATERLEVEL_W_MIN_DIGITS,

http://dive4elements.wald.intevation.org