X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2FUtil.js;h=3eb59e3db6c1351431ccb967d5e4ce280caaf794;hb=901b2ebbe25c116c93550cfca91b0704d751d997;hp=1fce3a0dd88bd4c370889f50d4d47dc9e4d7f1b9;hpb=d574a45ea4f06abe9b65be39a2ae4991f59257f3;p=dygraphs.git diff --git a/auto_tests/tests/Util.js b/auto_tests/tests/Util.js index 1fce3a0..3eb59e3 100644 --- a/auto_tests/tests/Util.js +++ b/auto_tests/tests/Util.js @@ -79,3 +79,15 @@ Util.assertFontSizes = function(parent, className, expectedSize) { assertEquals(expectedSizePx, fontSize); } }; + + +/** + * Takes in an array of strings and returns an array of floats. + */ +Util.makeNumbers = function(ary) { + var ret = []; + for (var i = 0; i < ary.length; i++) { + ret.push(parseFloat(ary[i])); + } + return ret; +};