unable to show decimals upto 3 digits, even though after keeping the scale attribute to 3

sri vyshnavi
Tera Expert

Hi,

 

I'm unable to show field value upto three decimals, on decimal type field. I added scale attribute to 3 and maxlenghth is set as 25. Still it is not working. It is showing only upto 2 decimals.

For Ex: If I put the value as 0.003. It is rounding of to 0. Here I want it as 0.003

If I put the value 0.032. It is rounding of to 0.03. Here I want it as 0.032.

 

Please give me solution without changing the type of the field.

 

Thanks in advance.

 

 

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi Sri,

Check for article once.

View solution in original post

5 REPLIES 5

BusraYalcindag
Tera Contributor

I also faced the same issue where setting scale=3 for a Decimal field didn’t work — values were still being rounded to 2 decimal places.

The key issue turned out to be this:

In ServiceNow, the max length must include both the digits before and after the decimal point.
So if your Decimal field has a total length of 15 digits by default, and you want 3 decimal places (scale=3), then your max length should be at least 18 (15 for the integer part + 3 for the decimal part).

Once I increased the max length accordingly, the field started storing 3-digit decimals correctly.

Hope this helps someone — it wasn’t obvious at first!