- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2023 03:39 AM
I am displaying total of multiple values in one currency field. But when sum is 8 digits it's showing something like 6.072 When the actual total of values is 60,701,831
Attaching a screenshot for reference
Could someone please explain this behavior? Does the currency field has some restrictions?
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2023 10:25 PM
Hello All,
I found the issue in my script and I have fixed it now. I am adding a solution here for everyone.
The script includes return value was in Hexadecimal value and hence it is set incorrectly causing the issue.
I changed line no.15
from: return total;
to: return total.toFixed(2);
After making the above change in script includes, issue seems to be resolved.
Also, it is a best practice to use "currency code" also while setting values to currency fields using client scripts.
Example:
var currency_code = 'INR';
g_form.setValue('fieldname ',currency_code + ';'+ response);
I have given my scripts below. I hope this helps someone looking for the same fix as I was.
Thanks!
Regards,
Harshada
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2023 04:01 AM
Hello @Harshada3 ,
Can you please check what is the Max length size of the Total Basic Value field in Configure dictionary.
Thanks,
Omkar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2023 04:05 AM
Hi Omkar,
The length of the field is 20. I don't think that is the issue here.
Regards,
Harshada
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2023 04:13 AM
@Harshada3 Then can you check the calculation is in same currenly because if you see that 60,701,831 amount i think is getting round off 60702 in the screen shot you shared. just a thought from my end.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2023 04:16 AM
The calculation is working fine for other records. Yes it is getting round off value but it's having decimal point. It's showing 6.0702.
Regards,
Harshada