From 2581a4b990ffbfb999cbd95731188032a1e1e38a Mon Sep 17 00:00:00 2001 From: Clemens Stolle Date: Wed, 27 Jun 2012 17:27:23 +0300 Subject: [PATCH] much faster default tickFormatter() - toFixed() is sloooow http://jsperf.com/tofixed-vs-factor --- jquery.flot.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jquery.flot.js b/jquery.flot.js index 0817fd8..ce7253b 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -1219,7 +1219,8 @@ }; axis.tickFormatter = function (v, axis) { - return v.toFixed(axis.tickDecimals); + var factor = Math.pow(10, axis.tickDecimals); + return Math.round(v * factor) / factor; }; }