How do I limit decimal points in a currency field?

JDavies549
Tera Expert

Hi all,

I'm currently building a form, and on it I have several fields which hold a monetary value. I have selected Currency as the field type. However, I have been tasked with limiting the decimal points (to 2) to avoid the potential of erroneous values being entered. Currently, the max length is 15 and I am free to enter any value I want.

I tried changing the default value to 7 which may help, but it will always default back to 15. I tried adding scale=4 to the attributes section, but this didn't make any difference to the field. I even tried the scale=4 on the decimal field type and this didn't seem do anything either. I followed this old guide but it might be out of date by now?  I also tried following this New York guide, but I couldn't find glide.currency_price.use_all_fraction_digits in the list.

Does anyone have any ideas or different approaches to this?

Thank you,

Jon 

3 REPLIES 3

Joshwa Antony S
Mega Guru

Hello Jon,

find_real_file.png

https://docs.servicenow.com/bundle/newyork-platform-administration/page/administer/currency/task/cha...

Create the property and set the value accordingly, if the property is not available in your system.

Regards,

JAS

Hi Jas, 
I have tried and set the value to False so that it can display only 2 decimals but it is not working. At the end it is restricted to 4 decimal points only. What might be the problem can anybody help me please. 
Thanks in advance!

 

JDavies549
Tera Expert

Thank you JAS.

I will try this and see if it works 🙂