Currency value not displaying 8 digit total sum

Harshada3
Tera Expert

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

Harshada3_0-1674560211773.png

Could someone please explain this behavior? Does the currency field has some restrictions?

Thank you!

 

1 ACCEPTED SOLUTION

Harshada3
Tera Expert

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

View solution in original post

11 REPLIES 11

Omkar Kumbhar
Mega Sage
Mega Sage

Hello @Harshada3 ,

Can you please check what is the Max length size of the Total Basic Value field in Configure dictionary.

Thanks,

Omkar

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

Hi Omkar,

The length of the field is 20. I don't think that is the issue here.

 

Regards,

Harshada

@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.

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

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