Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How do I do proper regional formatting in iOS? (Xamarin.Forms)

$
0
0

I have read about a million posts on the topic and all the approaches I have seen thus far appear to be incomplete.

Configuration 1
Language = Español (España), Region = España.
Using this configuration I create a new CultureInfo("es-ES") and assign it to DefaultThreadCurrentCulture and DefaultThreadCurrentUICulture, everything works as expected. My numbers are formatted correctly I.e. 234,55, the numeric keyboard pops up using the "," as decimal separator. Life is good.

Configuration 2
Language = Español (España), Region = Canada.
Using this configuration I create a new CultureInfo("es-CA") which of course fails. I then fallback to new CultureInfo("es") and assign it to DefaultThreadCurrentCulture and DefaultThreadCurrentUICulture. Under this configuration my numbers are formatted using "," which I expect but the numeric keyboard utilizes "." as the decimal separator.

Is it possible to have the keyboard respect the threads culture settings? How does iOS decide that the decimal separator should be "." when Canada supports point and comma?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>