Notifications

59 views

Description

Some browsers use a comma (,) instead of a period (.) as decimal separator. For example, having a decimal field in the incident table, if the user types 1.5 and moves the cursor to another field, the value will be modified to 15. But if the user enters 1,5 then the value is not modified, and the comma will take as decimal separator.  

The behavior is not the same in other browsers and the user wants to use a period as decimal separator in ALL browsers.

Cause

The browser Language dictates the decimal separator to use. 

Resolution

Go to the Browser setting and review the Languages installed. Please notice that some Languages, such as Spanish from Spain uses a comma as decimal separator.

The following code can be executed from the "Scripts - Background", it will display the decimal separator used by the browser:

var locale = GlideLocale.get();
var decimalSeparator = locale.getDecimalSeparator();
gs.info( "The decimal separator is " + decimalSeparator);


For more information about GlideLocale, review: 

GlideLocale - Scoped
https://docs.servicenow.com/bundle/orlando-application-development/page/app-store/dev_portal/API_reference/GlideLocaleScoped/concept/c_GlideLocaleScopedAPI.html

Article Information

Last Updated:2020-06-29 19:01:31
Published:2020-06-30