- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2021 05:47 AM
Hi,
I have a decimal field Payback period but it does not show decimal value.
19350/252 = 77.4 but it shows only 77.
Client script for that is,
Thanks,
Vaishnavi
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2021 06:53 AM
script i have tested on my personal instance and worked.
function onSubmit() {
//Type appropriate comment here, and begin script below
var currency_amount = g_form.getIntValue('total_costs');
var currency_code = g_form.getIntValue('score');
g_form.setValue('u_mytest', currency_code/currency_amount);
}
u_mytest was initially as "integer" type . and i had more than 20 record which was holdig the value, i just deleted and changed the type and then applied onSubmit client script to set the value and its setting as decimal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2021 06:05 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2021 06:31 AM
Can you try this finally:
I assume both the fields are cost type.
var tpc =g_form.getValue('u_total_project_cost.display').replace(/,/g, "");
var neb =g_form.getValue('financial_benefit.display').replace(/,/g, "");
var total2 = parseFloat(tpc)/parseFloat(neb);
//alert('tpc = '+tpc+' neb = '+neb+' total2 = '+total2);
g_form.setValue('u_payback_period',total2);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2021 06:34 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2021 06:39 AM
You are using g_form.getIntValue
Use g_form.getValue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2021 06:50 AM
getValue doesnot even work. Its not showing any value only if I use that