Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java @ 9361:2aec052d4088
Refactoring on SalixLineCalculationResult etc., calculation using MQ etc., scenario (regional+supra) csv columns and meta data added
author | mschaefer |
---|---|
date | Wed, 01 Aug 2018 18:01:11 +0200 |
parents | 7dc238bd062c |
children | 8aa1605e58f1 |
comparison
equal
deleted
inserted
replaced
9360:ddcd52d239cd | 9361:2aec052d4088 |
---|---|
94 public static final int SQ_RELATION_B_MIN_DIGITS = 3; | 94 public static final int SQ_RELATION_B_MIN_DIGITS = 3; |
95 | 95 |
96 // OTHER | 96 // OTHER |
97 public static final int CSV_DIAGRAM_DATA_MAX_DIGITS = 3; | 97 public static final int CSV_DIAGRAM_DATA_MAX_DIGITS = 3; |
98 public static final int CSV_DIAGRAM_DATA_MIN_DIGITS = 3; | 98 public static final int CSV_DIAGRAM_DATA_MIN_DIGITS = 3; |
99 private static final double W_ROUND_MULT = 100.0; | |
99 | 100 |
100 // S-INFO | 101 // S-INFO |
101 public static final int FLOWDEPTH_MAX_DIGITS = 2; | 102 public static final int FLOWDEPTH_MAX_DIGITS = 2; |
102 private static final double FLOWDEPTH_ROUND_MULT = 100.0; | 103 private static final double FLOWDEPTH_ROUND_MULT = 100.0; |
103 | 104 |
390 | 391 |
391 public static NumberFormat getW(final CallContext context) { | 392 public static NumberFormat getW(final CallContext context) { |
392 return Formatter.getFormatter(context, 2, 2); | 393 return Formatter.getFormatter(context, 2, 2); |
393 } | 394 } |
394 | 395 |
396 public static double roundW(final double value) { | |
397 return Math.round(value * W_ROUND_MULT) / W_ROUND_MULT; | |
398 } | |
399 | |
395 /** | 400 /** |
396 * Another waterlevel formatter with fixed digits (always 2) | 401 * Another waterlevel formatter with fixed digits (always 2) |
397 */ | 402 */ |
398 public static NumberFormat getWaterlevelW2(final CallMeta meta) { | 403 public static NumberFormat getWaterlevelW2(final CallMeta meta) { |
399 return getFormatter(meta, 2, 2); | 404 return getFormatter(meta, 2, 2); |