Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Entry field bound to double field, "," as decimal symbol get lost

ja_luja_lu Member ✭✭

Hi,

I've got an entry field which is bound to a double field in the model class. The binding works as it should (until now).
private double? _height; public double? Height { get => _height; set { _height = value; OnPropertyChanged(); } }
When I entry something like "11,1" or "89,5" into the field and check in the debuger which value my height field has now its always without the "," so the value that gets saved into the DB is worng (111 and 895).

If I write it lik 11.1 its correct. When I look at it in the Database its 11,1 (I guess cause of the german system) BUT when I retireve the data now from the DB it really comes as 11,1 and is now prefilled in my entry field with 11,1.

so if i save now, without changing anything, the value in the DB will be changed from 11,1 -> 111

I have attached an image of some infos.

My app has de-DE Culture, so "," should be the decimal symbol.

anyone experienced the same? how can I force the binding to use the decimal symbol of the actual culture (if this is the source of the problem)

thank you


Answers

Sign In or Register to comment.