changeset 851:4bcf7bf4bfb7

Presentation of values in the statistic is now language specific (issue228). gnv-artifacts/trunk@967 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 21 Apr 2010 13:38:26 +0000
parents 39d06d01825a
children b5f4b6073cde
files gnv-artifacts/ChangeLog gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java
diffstat 2 files changed, 17 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog	Wed Apr 21 12:34:44 2010 +0000
+++ b/gnv-artifacts/ChangeLog	Wed Apr 21 13:38:26 2010 +0000
@@ -1,3 +1,11 @@
+2010-04-21  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	  Issue228
+
+	* src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java:
+	  The presentation of values contained in the statistic are language
+	  specific, now.
+
 2010-04-21  Ingo Weinzierl <ingo.weinzierl@intevation.de>
 
 	  Issue217
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java	Wed Apr 21 12:34:44 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java	Wed Apr 21 13:38:26 2010 +0000
@@ -5,6 +5,7 @@
 import java.io.UnsupportedEncodingException;
 
 import java.text.DateFormat;
+import java.text.NumberFormat;
 import java.text.ParseException;
 
 import java.util.ArrayList;
@@ -482,7 +483,7 @@
                     statistics = new ArrayList<StatisticSet>();
                 }
 
-                Document doc = writeStatistics2XML(statistics);
+                Document doc = writeStatistics2XML(statistics, locale);
 
                 XMLUtils.toStream(doc, outputStream);
 
@@ -683,9 +684,14 @@
      * @param statistic Statistic to be written to xml document.
      * @return the xml document containing the statistic.
      */
-    protected Document writeStatistics2XML( Collection<StatisticSet> statistic) {
+    protected Document writeStatistics2XML(
+        Collection<StatisticSet> statistic, Locale locale)
+    {
         ArtifactXMLUtilities xmlUtilities = new ArtifactXMLUtilities();
         Document doc = XMLUtils.newDocument();
+
+        NumberFormat format = NumberFormat.getInstance(locale);
+
         if (statistic != null) {
             Node statisticResults = ArtifactXMLUtilities.createArtifactElement(doc,
                     "statistics");
@@ -703,7 +709,7 @@
                     Element result = ArtifactXMLUtilities.createArtifactElement(doc,
                     "statistic-value");
                     result.setAttribute("name", s.getKey());
-                    result.setAttribute("value", s.getStringValue());
+                    result.setAttribute("value", format.format(s.getValue()));
                     setElement.appendChild(result);
                 }
                 statisticResults.appendChild(setElement);

http://dive4elements.wald.intevation.org