[PATCH] issue1493: Don't let NaNs slip through csv export

Wald Commits scm-commit at wald.intevation.org
Mon Sep 23 11:26:25 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1379929033 -7200
# Node ID bdadffad35b10cb2205f10198e99fd1ad5898ff6
# Parent  99527ef3f1510717a6f561ee8a3ae44ca4d31b04
issue1493: Don't let NaNs slip through csv export.
Use the empty String instead.

diff -r 99527ef3f151 -r bdadffad35b1 artifacts/src/main/java/org/dive4elements/river/exports/ChartExportHelper.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ChartExportHelper.java	Mon Sep 23 11:24:17 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ChartExportHelper.java	Mon Sep 23 11:37:13 2013 +0200
@@ -349,7 +349,9 @@
                 String yString;
                 try {
                     xString = format.format(data.getX(i, j));
-                    yString = format.format(data.getY(i, j));
+                    yString = java.lang.Double.isNaN(data.getYValue(i, j))
+                        ? ""
+                        : format.format(data.getY(i, j));
                 }
                 catch (NumberFormatException nfe) {
                     xString = data.getX(i, j).toString();


More information about the Dive4elements-commits mailing list