Update percentageBars.js

prevent d.replace() is not a function error when d is a number rather than string
pull/368/head
Luiz Felipe Aranha 7 years ago committed by GitHub
parent ff051b8bcf
commit 8b4f1f1394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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}

Loading…
Cancel
Save