Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/AbstractExporter.java @ 418:e0fec407a280
ISSUE-53 Formatted number values of CSV exports.
flys-artifacts/trunk@1885 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 10 May 2011 16:10:01 +0000 |
parents | 340dc41a7ea3 |
children | a7947972fdeb |
comparison
equal
deleted
inserted
replaced
417:e54053bc0e70 | 418:e0fec407a280 |
---|---|
1 package de.intevation.flys.exports; | 1 package de.intevation.flys.exports; |
2 | 2 |
3 import java.io.IOException; | 3 import java.io.IOException; |
4 import java.io.OutputStream; | 4 import java.io.OutputStream; |
5 import java.io.OutputStreamWriter; | 5 import java.io.OutputStreamWriter; |
6 import java.text.NumberFormat; | |
7 import java.util.Locale; | |
6 | 8 |
7 import org.w3c.dom.Document; | 9 import org.w3c.dom.Document; |
8 | 10 |
9 import org.apache.log4j.Logger; | 11 import org.apache.log4j.Logger; |
10 | 12 |
177 | 179 |
178 writeCSVData(writer); | 180 writeCSVData(writer); |
179 | 181 |
180 writer.close(); | 182 writer.close(); |
181 } | 183 } |
184 | |
185 | |
186 protected NumberFormat getFormatter(int min, int max) { | |
187 Locale locale = Resources.getLocale(context.getMeta()); | |
188 NumberFormat nf = NumberFormat.getInstance(locale); | |
189 | |
190 nf.setMaximumFractionDigits(max); | |
191 nf.setMinimumFractionDigits(min); | |
192 | |
193 return nf; | |
194 } | |
182 } | 195 } |
183 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 196 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |