Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
205
Edit number directly in 0.00E0 scientific form
posted

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.