Data type for more than 2 decimal places

l237598
Giga Contributor

I'm uncertain what Type to use for a new column that will hold values with 4 decimal places.
The Wiki "Introduction to Fields" says type of decimal has only 2 decimal places, and type of integer has no decimal places.

I see types of numeric and float in the type choice list, but don't know which, if either, of these would be appropriate for storing values with 4 decimal places.
When I try those types, neither of them gives me a place to define the number of decimal places for the column.

Can anyone provide guidance for me?
Thanks!

7 REPLIES 7

CapaJC
ServiceNow Employee
ServiceNow Employee

Try giving your decimal field an attribute of "scale=4" (without quotes) in its Dictionary definition. I think that will do what you want.


Mark Stanger
Giga Sage

I've never been able to get this to work correctly until now. It turns out it's actually a combination of Max length for the field and the scale attribute. Check out this link for details.

http://www.servicenowguru.com/system-definition/controlling-decimal-field-places/


Hi all,



I've come across a limitation.



Do you know if there is a limit for this? I've explored this Decimal type in mysql and it states that the maximum number can be up to 65 and the decimal points could be up to 30.



I've tried this in SN since I have some input that takes 15(!) decimal cases.. But after definins scale=15 and maxlength= 30, when i try to create a new record with this amount of decimal cases, i can only write up to 12 digits right to the comma.



Is this a known issue? The max value for decimal cases is 12? or is there a way around this?



Thank you all


Hi Antonio,



Did you get any workaround for this. I am facing the same issue wherein it gives "Invalid Decimal Number" on touching 10 million with 2 decimal places.



Thanks in advance!!!




Regards,


Wasim