Thursday, December 19, 2013

Android: Determine Decimal Separator

In many applications you probably want to display numbers in the correct format of the user or read-in numbers.
Since Visual Studio and Xamarin use as a decimal separator the decimal point ("."), for this maybe a manual conversion has to be done, depending on the settings of the user.
Therefore I post here 2 lines of code, with which the decimal separator of the system can be determined:

Java.Text.DecimalFormatSymbols FormatSymbols = new Java.Text.DecimalFormatSymbols();
char DecimalSeparator = FormatSymbols.DecimalSeparator;

No comments:

Post a Comment