From 8b4f1f13944e62f206641ca95cd351538fa23e4e Mon Sep 17 00:00:00 2001 From: Luiz Felipe Aranha Date: Tue, 6 Mar 2018 11:56:01 -0300 Subject: [PATCH] Update percentageBars.js prevent d.replace() is not a function error when d is a number rather than string --- dataRender/percentageBars.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataRender/percentageBars.js b/dataRender/percentageBars.js index 4b41dc3..9c31e61 100644 --- a/dataRender/percentageBars.js +++ b/dataRender/percentageBars.js @@ -71,7 +71,7 @@ jQuery.fn.dataTable.render.percentBar = function(pShape, cText, cBorder, cBar, c return function(d, type, row) { //Remove % if found in the value //Round to the given parameter vRound - s = parseFloat(d.replace(/\s%|%/g,'')).toFixed(vRound); + s = parseFloat(d.toString().replace(/\s%|%/g,'')).toFixed(vRound); //Not allowed to go over 100% if(s>100){s=100}