Question
Trim upto 2 decimal points + js
Hi,
I want to trim a decimal number upto 2 decimal points.ie i want to show only 2 digits after the decimal point.How do i acheive this in Javascript. I do not want to use the Round function as it causes the value to change by 0.01.
this is the code i've been using:-
document.getElementsByName("totalincvat_value_nett")[0].value = parseFloat(totalincvat_value_nett).toFixed(2);
Is there any way to show upto 2 decimal points and cut off the rest?
thnx
I want to trim a decimal number upto 2 decimal points.ie i want to show only 2 digits after the decimal point.How do i acheive this in Javascript. I do not want to use the Round function as it causes the value to change by 0.01.
this is the code i've been using:-
document.getElementsByName("totalincvat_value_nett")[0].value = parseFloat(totalincvat_value_nett).toFixed(2);
Is there any way to show upto 2 decimal points and cut off the rest?
thnx
