Javascrip Sum Item and control out put to two decimal point.
My que. is related to javascrip for sum item and control out put to two decimal point
Sum the Tax Amount Item I use following javascrip code in HTML Header
function sumst()
{
function getVal(item){
if($x(item).value != "")
return parseFloat($x(item).value);
else
return 0;
}
$x('P25_TAX_AMT').value = Math.round(
(getVal('P25_TXBL_AMT') * getVal('P25_STP')/100 ));
}
Result is in Round off
Or
function sumst()
{
function getVal(item){
if($x(item).value != "")
return parseFloat($x(item).value);
else
return 0;
}
$x('P25_TAX_AMT').value =
(getVal('P25_TXBL_AMT') * getVal('P25_STP')/100 );
}
Result in more then three decimal point
My Net Amount is 98089.80
Tax Rate 4 %
Tax Amount 3924 when I use Math.round
or
if I not use Math.round the tax Amount is 3923.592
I won't result 3923.59 ?
What Change i have to do in my javascript to get above result i.e. 3923.59
My current ver of apex is 3.2