I have a form on a website I inherited that performs a calculation with JavaScript. I would like to know how to get the result to display 1 decimal place. I have almost no experience with JavaScript. I did a search, but didn't understand how to apply the answers. I would appreciate any help. thanks
Here is (I think) the relevant code:
function formatvalue(input, rsize) {
var invalid = "**************************";
var nines = "999999999999999999999999";
var strin = "" + input;
var fltin = parseFloat(strin);
if (strin.indexOf("e") != -1 ||
fltin > parseFloat(nines.substring(0,rsize)+".4"))
return invalid.substring(0, rsize);
if (strin.length <= rsize) return strin;
var rounded = "" + (fltin +
(fltin - parseFloat(strin.substring(0, rsize))));
return rounded.substring(0, rsize);
}