I would like to present the editable number to my end user in form 0.00E0 scientific form
Say given a double variable with value 0.000123 firstly I would like to show this as 1.23E-4 and let the user edit both the exponent and mantissa.
So the user can edit the -4 to be -5 and the 1.23 to be 2.56 to have 2.56E-5, then the binding puts the value to my double variable 0.0000256.
If the user "deletes" the E character from the edited text I must detect and handle somehow the error, but ideally the input control should not let to do this (should prevent issuing not interpretable input)
I've tried to play both with formatting and inputmasks with no success
Thanks for answers.
Hi,
I think you would have to use an XamTextEditor and create an IValueConverter class to provide the logic for converting to and from the string. Then you would set the xamTextEditors's ValueToTextConverter and ValueToDisplayTextConverter properties to an instance of this class.
One more thing you may need to use is a ValidationRule set on the xamTextEditor to prevent them from removing the E when editing the value.
I hadn’t heard back from you and I was wondering if you had any questions.