From 8ff2dc362c960d9392f09e236a57b1bcac18d3d0 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 11 Jan 2015 08:31:38 -0500 Subject: [PATCH] this fixes #471 --- src/js/popup.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/popup.js b/src/js/popup.js index b1ebe6adb..7143a0631 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -211,8 +211,9 @@ var updateDynamicFilterCell = function(scope, des, type, rule) { if ( aCount === 0 && bCount === 0 ) { return; } - aCount = Math.min(Math.ceil(Math.log10(aCount + 1)), 3); - bCount = Math.min(Math.ceil(Math.log10(bCount + 1)), 3); + // https://github.com/gorhill/uBlock/issues/471 + aCount = Math.min(Math.ceil(Math.log(aCount + 1) / Math.LN10), 3); + bCount = Math.min(Math.ceil(Math.log(bCount + 1) / Math.LN10), 3); // IMPORTANT: It is completely assumed the first node is a TEXT_NODE, so // ensure this in the HTML file counterpart when you make // changes