Why can't I set decimals in a decimal field?
Options
- 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:
met.u_total_value = 4.25;
met.update();
It's updating the field to 4 instead of keeping the decimals. Why is my decimal disappearing and how do I keep it?
7 REPLIES 7
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 07:04 AM
share the dictionary screenshot of that field.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 06:50 AM
Hello @e_wilber
Screenshot of u_total_value dictionary:
Before:
After your code executed in Scripts - Background:
var grInc = new GlideRecord('incident');
grInc.get('ed92e8d173d023002728660c4cf6a7bc');
var tst = 4.25;
grInc.u_total_value = parseFloat(tst.toFixed(2));
grInc.update();
Hope that helps!

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2025 07:06 AM - edited 04-07-2025 07:07 AM
I do this in Catalog requests & platform forms.
1. Platform UI
Type = Price
2. Attributes
edge_encryption_enabled=true,omit_sys_original=true,serializer=com.glide.script.PriceXMLSerializer
3. After update : 
Estimated Total Project Amount $
In Catalog
1. Type = Single Line Text
2. Check the values are getting set
var cs = g_form.getValue('cost');
var letter = /^[0-9.]+$/;
if ((cs.match(letter))) {
var value = Math.round(cs*1000)/1000; // 10 defines 1 decimals, 100 for 2, 1000 for 3
}
else {
return false;
}
3; in the workflow
var cost_if_known = parseFloat(current.variables.cost.toString());
Both works for me!!