diff runner/JAMSFeatureWriter.cpp @ 192:bb295c0feb3e

Fix JSON validity
author Chris Cannam
date Wed, 22 Jul 2015 14:34:26 +0100
parents 089f1a13963d
children 3b7ec45abd1c
line wrap: on
line diff
--- a/runner/JAMSFeatureWriter.cpp	Wed Jul 22 14:25:14 2015 +0100
+++ b/runner/JAMSFeatureWriter.cpp	Wed Jul 22 14:34:26 2015 +0100
@@ -147,14 +147,17 @@
             d += QString(", \"value\": [ ");
             for (int j = 0; j < int(f.values.size()); ++j) {
                 if (isnan(f.values[j])) {
-                    d += "\"NaN\" ";
+                    d += "\"NaN\"";
                 } else if (isinf(f.values[j])) {
-                    d += "\"Inf\" ";
+                    d += "\"Inf\"";
                 } else {
-                    d += QString("%1 ").arg(f.values[j]);
+                    d += QString("%1").arg(f.values[j]);
+                }
+                if (j + 1 < int(f.values.size())) {
+                    d += ", ";
                 }
             }
-            d += "]";
+            d += " ]";
         }
             
         d += " }";