Having trouble with an error message: "cannot read tostring()". I've included my code below for reference:
function convertRounding(nValue) {
var sArr = nValue.toString("0.00000").split('.');
**var sVal = sArr[1].toString();**
if (sVal == "00000" || sVal.substring(1) == "0000" || sVal.substring(2) == "000")
return parseFloat(nValue).toFixed(2);
else if (sVal.substring(3) == "00")
return parseFloat(nValue).toFixed(3);
else if (sVal.substring(4) == "0")
return parseFloat(nValue).toFixed(4);
else
return parseFloat(nValue).toFixed(5);
}