- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 01:12 AM
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.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 01:37 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 01:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 01:40 AM
Hi @sri vyshnavi ,
This is expected behaviour. The max length value needs to be changed at the same time as the scale value in order to have the correct values at the database level. If you change the scale alone then the DB does not reflect the change, which means the default values are still used.
- Open the Advanced view of the dictionary entry for the Decimal field of your table
- Add "scale=5" (or another number) to the attributes field
- Click on "Save"
- Modify the field value of "Max length" to something different than it currently is (the default is 20)
- Click on "Save"
If you created a new column of type decimal and don’t set the scale initially, it will default to 2.
If you then change the scale value to another number then you need to change the max length value twice in order to have the DB reflect the scale value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 01:41 AM
This is taken from the same Article mentioned by @Jaspal Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2023 03:36 AM
Workaround
This is expected behaviour. The max length value needs to be changed at the same time as the scale value in order to have the correct values at the database level. If you change the scale alone then the DB does not reflect the change, which means the default values are still used.
- Open the Advanced view of the dictionary entry for the Decimal field of your table
- Add "scale=5" (or another number) to the attributes field
- Click on "Save"
- Modify the field value of "Max length" to something different than it currently is (the default is 20)
- Click on "Save"
If you created a new column of type decimal and don’t set the scale initially, it will default to 2.
If you then change the scale value to another number then you need to change the max length value twice in order to have the DB reflect the scale value.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************