how to retains decimal field 2 places after record submits
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2017 10:31 PM
I am stuck at a decimal field cosmetic where the 2 places need to present always, for example, if users enter 123.00, the .00 need to stay when the record is submitted.
In ServiceNow, this is not a difficult thing to do if the field is set to Currency or Price, however, due to the limitation of list editing. The users are not able to edit in List view; therefore I had to work this around by changing it to a decimal field which allows users to edit, which is great!!
However, the Decimal field does not retain the 2 places after submitting when a whole number is entered, e.g 123.00
After submitting the record, the 2 places are gone
Is any way to always retain the 2 places all the time.
Thanks.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2017 03:32 PM
Thanks Shloke,
I put a new before business rule on the decimal field to retain the two decimal places.
after testing it seems taking no effect on the field despite the BR does fire,
but for display, the two places are still missing. I will need to find other way to tack this.
Appreciate your attempt to help.
Kind regards,
George

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2017 11:30 PM
Please have the attribute set as scale=4 for decimal field. Hope that helps.
Reference: https://www.servicenowguru.com/system-definition/controlling-decimal-field-places/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2017 03:20 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2017 03:34 PM
I have tested y'day with toFixed() too but that didn't help. I will try to find another way to achieve if possible and will let you know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2017 03:47 PM
Much appreciated, I will also keep looking for solutions.
Thank you again.
Regards,
George