Good day Everyone!
I want to know how to return the output with two decimal places. Instead of 10,000 I want it to return 10,000.00.
When the amount has decimal number other than zero, the values appear on the printout, but when the decimal number has a zero value, the Zeros won't appear on the printout.
Also, I have added a value of Wtax that was pulled-out on a "Bill Credit" Transaction.
Please refer to my code below:
if(search.length>0){
layout += '<tr>';
layout += '<td border="0px" colspan="6" style="font-size:11pt;">';
for(var x = 0;x<search.length;x++){
layout += iE(search[x].getText('account'))+'<br/>';
}
if(!isEmpty(wtaxamt)){
layout += 'WTAX';
}
layout += '</td>';
layout += '<td border="0px" width="3.8cm" style="font-size:11pt;">';
for(var x = 0;x<search.length;x++){
if(!isEmpty(wtaxamt)){
if(search[x].getValue('debitamount')>0){
layout += addCommas(parseFloat(search[x].getValue('debitamount'))+parseFloat(wtaxamt))+ '<br/>';
}
else{
layout += ' '+addCommas(search[x].getValue('creditamount'))+'<br/>';
layout += ' '+addCommas(wtaxamt)+'<br/>';
}
}
Output:
[ATTACH=CONFIG]n412222[/ATTACH]