Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure android EditText to allow decimals and negatives

I have an Android EditText that I want to have the number keyboard come up.

If I set the android:inputType to numberSigned, I get the number keyboard and the ability to type in negatives. However this won't let me use decimals. If I use the numberDecimal inputType I can use decimals but not negatives.

How do you get the number keyboard with the ability to type in decimals and negatives?

like image 717
Owen Campbell Avatar asked Sep 25 '11 05:09

Owen Campbell


1 Answers

You are just missing this in your EditText,

android:inputType="numberDecimal|numberSigned" 
like image 180
Lalit Poptani Avatar answered Oct 13 '22 21:10

Lalit Poptani