Calculate percentage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2018 10:27 AM
Hello,
we have a requirement to show total value include tax.
e ,g cost 1 = 800
tax= 18% tax on 800
total= cost1+ 18% tax on 800,
I have tried flowing on load client script but no luck,
function onLoad() {
//Type appropriate comment here, and begin script below
var sns = g_form.getValue('cost_1');
var ens = parseInt((cost_1)*18/100);
var total =parseInt(sns) + parseInt(ens);
alert(total);
g_form.setValue('t',total);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2018 12:52 PM
Hi, tried working fine for me.
function onLoad() {
//Type appropriate comment here, and begin script below
var q = g_form.getValue('cost'); //here the cost type is currency
var w =q.split(';')[1] ;
w = w.replace(/,/g, "");
var percent =w*1.8;
alert(q);
alert(w);
alert(percent);
}
give it a try,Mark helpful/correct if it helps.
Thanks,Naveen