comparison artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java @ 6207:a82a724356f0

Updade sq relation pdf export as specified in issue1071
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 05 Jun 2013 14:44:36 +0200
parents 58a613798386
children 8c976bb0362f
comparison
equal deleted inserted replaced
6206:743eab7acfdb 6207:a82a724356f0
86 public static final int FIX_DELTA_W_DELTA_W_MIN_DIGITS = 3; 86 public static final int FIX_DELTA_W_DELTA_W_MIN_DIGITS = 3;
87 public static final int FIX_DELTA_W_DELTA_W_MAX_DIGITS = 3; 87 public static final int FIX_DELTA_W_DELTA_W_MAX_DIGITS = 3;
88 public static final int FIX_DELTA_W_DELTA_Q_MIN_DIGITS = 0; 88 public static final int FIX_DELTA_W_DELTA_Q_MIN_DIGITS = 0;
89 public static final int FIX_DELTA_W_DELTA_Q_MAX_DIGITS = 2; 89 public static final int FIX_DELTA_W_DELTA_Q_MAX_DIGITS = 2;
90 90
91 public static final int VARIANCE_MIN_DIGITS = 0; 91 public static final int VARIANCE_MIN_DIGITS = 3;
92 public static final int VARIANCE_MAX_DIGITS = 4; 92 public static final int VARIANCE_MAX_DIGITS = 3;
93 93
94 // SQ Relation 94 // SQ Relation
95 public static final int SQ_RELATION_MAX_DIGITS = 8; 95 public static final int SQ_RELATION_A_MAX_DIGITS = 7;
96 public static final int SQ_RELATION_MIN_DIGITS = 0; 96 public static final int SQ_RELATION_A_MIN_DIGITS = 7;
97 public static final int SQ_RELATION_B_MAX_DIGITS = 3;
98 public static final int SQ_RELATION_B_MIN_DIGITS = 3;
97 99
98 /** 100 /**
99 * Creates a localized NumberFormatter with given range of decimal digits. 101 * Creates a localized NumberFormatter with given range of decimal digits.
100 * @param m CallMeta to find the locale. 102 * @param m CallMeta to find the locale.
101 * @param min minimum number of decimal ("fraction") digits. 103 * @param min minimum number of decimal ("fraction") digits.
435 context, 437 context,
436 VARIANCE_MIN_DIGITS, 438 VARIANCE_MIN_DIGITS,
437 VARIANCE_MAX_DIGITS); 439 VARIANCE_MAX_DIGITS);
438 } 440 }
439 441
440 public static NumberFormat getSQRelation(CallContext context) { 442 public static NumberFormat getSQRelationA(CallContext context) {
441 // Would be nice if E0 would not be shown 443 return getFormatter(
442 return getScientificFormater( 444 context,
443 context, 445 SQ_RELATION_A_MIN_DIGITS,
444 SQ_RELATION_MIN_DIGITS, 446 SQ_RELATION_A_MAX_DIGITS);
445 SQ_RELATION_MAX_DIGITS); 447 }
448
449 public static NumberFormat getSQRelationB(CallContext context) {
450 return getFormatter(
451 context,
452 SQ_RELATION_B_MIN_DIGITS,
453 SQ_RELATION_B_MAX_DIGITS);
446 } 454 }
447 455
448 public static NumberFormat getMeterFormat(CallContext context) { 456 public static NumberFormat getMeterFormat(CallContext context) {
449 return getFormatter( 457 return getFormatter(
450 context, 458 context,

http://dive4elements.wald.intevation.org