- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2015 01:59 AM
Hi All,
I have created a field(String data type) and populating average value to that field. The process is fine but its is populating upto 8 decimal points because the field is string type. is there any available attribute(for the variables) to round off the average value and populate the value with only two decimal points(a.bc).
Thanks & Regards,
Swamy
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2015 02:39 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2015 02:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2015 02:23 AM
Hi Pradeep,
The problem here is that i have defined field data type as string instead of decimal value. If i change the data type now then the data stored in the field will be erased. That's why is there any way to round off the average value to 2 decimal places for string data type fields.
Thanks & Regards,
Swamy

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2015 02:33 AM
Hi,
Thanks for the update. Try this with the client script.
var val = g_form.getValue('u_sal');
var dec = Math.round(val * 100) / 100;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2015 02:39 AM
Please try x = x.toFixed(2);