Hi all
In a TA Process, the function
NumberToString() seems to be language dependent.
This is a problem when for example someone in the US presses a button to export data to a file and someone in Europe presses a button to import the file.
Also if collages working side by side us the different browser language as default*
The decimal format of the data must be the same for both ends.
I also noticed that the functions
NumberToStirng() and
STR do behave differently.
NumberToString() does not use the defined DataSourceASCIIDecimalSeparator but the STR function does.
Here is the question:Do you have a nice solution or setting for me to make the cast function
NumberToString() independent of the browser language?
I created the following example to test some cast methods available
Using the SVALUE will work but In some cases, I need to invert the VALUE.
If I invert the value like this,
VALUE=-VALUE then the
SVALUE is not inverted and therefore cannot be mapped directly to the export.
Some casting of the
VALUE to text is then needed.
#Section Prolog

#Section Data
The result if I run this from a browser set to EnglishFunction SVALUE Result Code
SVALUE 115052.18 115052.18
SVALUE ...not inverted
NTS 115052.18 -115052.18 ValueNTS=NumberToSTring(
VALUE) .
..decimal seperator is language dependent NTSX 115052.18 -115052.18 ValueNTSX=NumberToStringEx(
VALUE, #.#0, DataSourceASCII... )
STR 115052.18 -115052.18 ValueSTR=TRIM(STR(
VALUE,12,2) )
The result if I run this from a browser set to the local language, in my case IcelandicFunction SVALUE Result Code
SVALUE 115052.18 115052.18
SVALUE ...not inverted
NTS 115052.18
-115052,18 ValueNTS=NumberToSTring(
VALUE)
...here is a problem. Wrong decimal separatorNTSX 115052.18 -115052.18 ValueNTSX=NumberToStringEx(
VALUE, #.#0, DataSourceASCII... )
STR 115052.18 -115052.18 ValueSTR=TRIM(STR(
VALUE,12,2) )
* The topmost language in the browser settings defines the regional format of numbers and dates
- chrome://settings/languages
- edge://settings/languages
- etc...
------------------------------
Asgeir Thorgeirsson
------------------------------