Decimal fields truncate trailing zeroes?

Not applicable

I have created a form with several decimal fields that I want to be formatted as #.##

However, upon save to the database table, the traling zeroes are removed. For example, 1.00 gets set to 1. And 2.50 gets set to 2.5. I would like for all of my numbers to have a certain precision so they line up when displayed in a list. I reviewed the forum and tried the scale=2 suggestion, but that doesn't work. I created a client script that take the field and formats it as #.## using JavaScript. However, as soon as the record is saved, the trailing zeroes/formatting are removed.

Any idea on how to do this or if it's possible?

Thanks!

10 REPLIES 10

Did you see my post with the guru link? I think that solves the issue described in this post.


Hey Mark,

Thanks for the reply. I tried using the scale attribute (scale=2) on a decimal field and it does not appear to keep the trailing zero. For example, if I type in 150.50, ServiceNow will truncate and only keep 150.5 as the value. ServiceNow hates zeros... Also, I'm on Berlin.


You'll probably need to talk to ServiceNow about this one. I can't even get the Scale attribute to work correctly on a Calgary demo environment right now. It looks like there's something that's changed with this but I'm not sure.


Hi All,



I am also looking for same functionality, hope somebody has does this.


Looking for luck!



Thanks!


geannaweed
Tera Contributor

Was there any resolution to this?