I have a unit converter and since the resultant number can be small or big, the requirement is to have only six decimals after the period. Like: 9680.123456
I have used this successfully:
v4 = parseFloat(Math.round(v2 * 100) / 100).toFixed(6);
document.MainForm.answer.value = (v4);
where v2 is the resulting number and v4 is displayed.
Issue is when the resulting number doesn't have decimal numbers but only 0 it is still displayed as:
98261.000000
I don't want these zeroes!! Pls help![]()


Reply With Quote
Bookmarks