changeset 8580:d9f038b8e2ce

(issue1753) Format S with only up to three fractional digits
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 16 Mar 2015 14:37:30 +0100
parents b058b4f153d3
children 073ea4bcea58
files artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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)

http://dive4elements.wald.intevation.org