[PATCH 2 of 2] (issue1753) Format S with only up to three fractional digits

Wald Commits scm-commit at wald.intevation.org
Mon Mar 16 14:37:35 CET 2015


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1426513050 -3600
# Node ID d9f038b8e2cec5fd33fbe99a40195b42307b28e8
# Parent  b058b4f153d37147ff5bb86ee0dad186ae04a35c
(issue1753) Format S with only up to three fractional digits

diff -r b058b4f153d3 -r d9f038b8e2ce artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java	Mon Mar 16 14:32:45 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java	Mon Mar 16 14:37:30 2015 +0100
@@ -258,6 +258,7 @@
         NumberFormat sqBFormatter = Formatter.getSQRelationB(context);
         NumberFormat fThreeFormatter = Formatter.getFormatter(context, 3, 3);
         NumberFormat fTwoFormatter = Formatter.getFormatter(context, 2, 2);
+        NumberFormat fZeroThreeFormatter = Formatter.getFormatter(context, 0, 3);
         NumberFormat fZeroFormatter = Formatter.getFormatter(context, 0, 0);
         DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT,
                 Resources.getLocale(context.getMeta()));
@@ -302,7 +303,7 @@
                         o, // 8
                         c_duan, // 9
                         c_ferguson, // 10
-                        sqAFormatter.format(sq.getS()),
+                        fZeroThreeFormatter.format(sq.getS()),
                         fZeroFormatter.format(sq.getQ()),
                         df.format(sq.getDate())
                     });
@@ -345,7 +346,7 @@
     protected SQMeasurementsJRDataSource createMeasurementJRData() {
         SQMeasurementsJRDataSource source = new SQMeasurementsJRDataSource();
         NumberFormat fZeroFormatter = Formatter.getFormatter(context, 0, 0);
-        NumberFormat fEightFormatter = Formatter.getFormatter(context, 0, 8);
+        NumberFormat fZeroThreeFormatter = Formatter.getFormatter(context, 0, 3);
         DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT,
                 Resources.getLocale(context.getMeta()));
 
@@ -357,7 +358,7 @@
                     for (SQ sq: fraction.getMeasurements()) {
                         source.addData(new String[] {
                             name,
-                            fEightFormatter.format(sq.getS()),
+                            fZeroThreeFormatter.format(sq.getS()),
                             fZeroFormatter.format(sq.getQ()),
                             df.format(sq.getDate()),
                             null
@@ -367,7 +368,7 @@
                         for (SQ sq: fraction.getOutliers(j)) {
                             source.addData(new String[] {
                                 name,
-                                fEightFormatter.format(sq.getS()),
+                                fZeroThreeFormatter.format(sq.getS()),
                                 fZeroFormatter.format(sq.getQ()),
                                 df.format(sq.getDate()),
                                 Integer.toString(j + 1)


More information about the Dive4Elements-commits mailing list