From: Dan Vanderkam Date: Tue, 14 Sep 2010 00:34:39 +0000 (-0700) Subject: more robust missing values X-Git-Tag: v1.0.0~664^2 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=41333ec0050007092282f3884b7ec6a2edffa853;p=dygraphs.git more robust missing values --- 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;