Decimal numbers and locale of the user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2018 06:57 AM
Hello there,
I have a question regarding the way of working with decimal numbers in decimal fields. Since that SNOW can use different way for settings the locale value (taken from sys_properties/user profile/browser settings) there can be various way to display decimal number. Actually I am facing the problem where my system locale decimal separator is "," and thousand separator " ". When I want to read the value from the decimal field I use g_form.getDecimalValue() which takes into account the locale of the user and basically converts the display number to javascript decimal number where decimal separator is "." (dot) Then I need to do some calculations and then set the calculated value back to different decimal value but taking to account locale, which means to convert the decimal value to comma separated decimal places. Here I didn't find any way how to convert the javascript decimal value to the display value of the current user (as an example I used decimal separator comma but I need this dynamic so it can be "." or ",") I would need something like g_form.setDecimalValue() but nothing like this exists + it should work in the Service portal as well.
Do you have any idea how can I set the decimal value in the format of locale for the user?
thanks for your help,
Jan
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2018 03:32 AM
Hi Jan,
I am facing same issue. Did you find any solution so far?
Thanks
Kavita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2023 01:38 AM
Hi,
Same problem here.
Currently I'm using string replacement, but that's just a lazy and overall bad ideea.
Did you find any solution so far?
Regards,
Samson
