Why can't I set decimals in a decimal field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 06:04 AM
I have a custom decimal field that I'm trying to update via a business rule:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 06:09 AM
Hello @e_wilber
Please see a similar thread here: https://www.servicenow.com/community/developer-forum/hi-all-i-am-trying-to-set-scale-8-in-a-decimal-...
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 06:15 AM
Hello @e_wilber
It's because it takes integer by default.
You need to parse it to float or double specifically.
Use below 👇
var decimalValue = parseFloat(met.u_total_value);
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 06:27 AM
are you sure the field type is Decimal and not Integer?
what happens when you manually enter?
share the field configuration screenshots here
try this once
met.u_total_value = parseFloat(4.25).toFixed(2);
met.update();
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 06:36 AM