How to enter a "Negative Decimal Number" in EditText?

android, android-edittext, exception, math

Solution

You can use both with the "|" operator. Just specify "numberSigned|numberDecimal".

Problem

I am making a calculator and I want to make sure that user is able to enter a "Negative Decimal Number" I see the option in the xml file separately for example in order to put the Decimal Number, the EditText's inputType must be numberDecimal and for negative number the inputType must be "numberSigned" but I need both. If I choose inputType as "text" then user is able to enter anything which throws an exception if it's not a number. I am not sure how to fix that either.

Original source

Related problems