What can be done to prevent numbers like this appearing in my output?
Here is my javascript code.
$("#TaskListing table tr td#Begin input").each(function (index, element) {
var theRow = $(element).parent().parent();
var thePercent = $(theRow).children("tr td#Percent:first");
currentvalue = $(theRow).data("millisecs");
fnumber = currentvalue / totalTimeMs;
thePercent.text( 100 * fnumber.toFixed(2));
});
Change your code to use toFixed like this.
thePercent.text( (100 * fnumber).toFixed(2) );
You want to perform the calculation first then send it to the toFixed() method