cancel
Showing results for 
Search instead for 
Did you mean: 

Edit Text get and write decimal value by different localization

0 Kudos

Hello Experts:

   I think this subject has been discussed quiet frequently and solutions tried and tested on multiple scenario's. Our development is for a customer with installation in multiple countries and localizations and we are now seen that different OS localization (control panel-> region -> number format) in combination of the SBO setting (general setting for decimal separator and thousand separator ) will cause problem.

   This is system table/matrix so I don't think I am allowed to work with the data source set directly. Which means i have to write to column as Edittext.value = XXX.

   In our initial attempt, we format to use a function to replace nature decimal place with System decimal places So if default value is 1.23 in local setting, then I am simply convert to text, replace . with whatever is set as decimal separator in general setting in SBO. That for some reason works sometimes and wouldn't work for some combination (Brazil local vs German DB)

   This seem should be straight forward, I originally thought by using edittext.value = mydoublevariable was already good enough. But again in US/US it works in GERMAN/GERMAN it doesn't quiet as well. In most case instead of getting 1,234 I get 1234 or 1,2340 I get 1234.

   Any help is much appreciated! Thank You!

Accepted Solutions (0)

Answers (1)

Answers (1)

pedro_magueija
Active Contributor
0 Kudos

Hi Bo,

I usually use the .ToString(CultureInfo.InvariantCulture) from a double value.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn