0
votes

I have an entry in Xamarin Forms that accepts numbers and I want to add a unit at the end.
They input:

163.23

And and it automatically changes it to:

163.23 mm

And when they focus it again or click on it, it gets deleted and they input into it again.

Is there any easy way to do this?

1

1 Answers

0
votes

You could put a label with the text 'mm' behind the entry.

Another option is to use StringFormat or a custom formatter.

https://developer.xamarin.com/guides/xamarin-forms/xaml/xaml-basics/data_binding_basics/ has a sample StringFormat and DoubleToIntConverter.