diff --git a/src/Core/src/Platform/Android/LocalizedDigitsKeyListener.cs b/src/Core/src/Platform/Android/LocalizedDigitsKeyListener.cs index 2ceb5c097ae1..ca1578918762 100644 --- a/src/Core/src/Platform/Android/LocalizedDigitsKeyListener.cs +++ b/src/Core/src/Platform/Android/LocalizedDigitsKeyListener.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Globalization; using Android.Text; using Android.Text.Method; using Java.Lang; @@ -17,17 +18,6 @@ public class LocalizedDigitsKeyListener : NumberKeyListener static Dictionary? UnsignedCache; static Dictionary? SignedCache; - static char GetDecimalSeparator() - { - if (!(NumberFormat.Instance is DecimalFormat format)) - return '.'; - - - DecimalFormatSymbols? sym = format.DecimalFormatSymbols; - - return sym == null ? '.' : sym.DecimalSeparator; - } - public static NumberKeyListener Create(InputTypes inputTypes) { if ((inputTypes & InputTypes.NumberFlagDecimal) == 0) @@ -39,7 +29,8 @@ public static NumberKeyListener Create(InputTypes inputTypes) } // Figure out what the decimal separator is for the current locale - char decimalSeparator = GetDecimalSeparator(); + var symbol = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator; + var decimalSeparator = string.IsNullOrEmpty(symbol) ? '.' : symbol[0]; if (decimalSeparator == '.') {