I\'m very new to html, javascript, and css so please forgive if my question sounds idiotic to you. My question is how can I prevent the function toFixed()
from
you can give this a try, it won't round your decimals
/**
* @param {any} input
* @param {number} decimals
*/
var toFixed = function(input, decimals) {
var arr = ("" + input).split(".");
if (arr.length === 1) return input;
var int = arr[0],
max = arr[1].length,
dec = arr[1].substr(0, decimals > max ? max : decimals);
return decimals === 0 ? int : [int, "." , dec].join("");
}