# HG changeset patch # User Chris Cannam # Date 1437572066 -3600 # Node ID bb295c0feb3e1460e4d902fe08666ad8f0019eca # Parent 4ef452f5fefcea0dfa592479c8d22bc6bedc3939 Fix JSON validity diff -r 4ef452f5fefc -r bb295c0feb3e runner/JAMSFeatureWriter.cpp --- 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 += " }";