From 41333ec0050007092282f3884b7ec6a2edffa853 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Mon, 13 Sep 2010 17:34:39 -0700 Subject: [PATCH] more robust missing values --- dygraph.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dygraph.js b/dygraph.js index ba266ab..37a9c30 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1900,8 +1900,8 @@ Dygraph.prototype.parseCSV_ = function(data) { // Parse the x as a float or return null if it's not a number. var parseFloatOrNull = function(x) { - if (x.length == 0) return null; - return parseFloat(x); + var val = parseFloat(x); + return isNaN(val) ? null : val; }; var xParser; -- 2.7.4