function d(a,b,d,e){var f,g,h=Math.pow(10,b);
// toFixed returns scientific notation for numbers above 1e21 and below 1e-7
// remove the leading negative sign if it exists and should not be present (e.g. -0.00)
// Multiply up by precision, round accurately, then divide and use native toFixed():
return a.toString().indexOf("e")>-1?(g=c(a,b),"-"===g.charAt(0)&&+g>=0&&(g=g.substr(1))):g=(d(a+"e+"+b)/h).toFixed(b),e&&(f=new RegExp("0{1,"+e+"}$"),g=g.replace(f,"")),g}
Implementation of toFixed() that treats floats more like decimals

Fixes binary rounding issues (eg. (0.615).toFixed(2) === '0.61') that present
problems for accounting- and finance-related software.

Also removes negative signs for zero-formatted numbers. e.g. -0.01 w/ precision 1 -> 0.0