Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android inputType="numberDecimal" brings up keyboard without commas

Tags:

java

android

So i have been playing around with a little game with some mathematical questions. The application gives you, for example, a question like 23 + 47, and that's fine and all, but when it gives you a question like 9/6 the problems appears. Since you input the result in an EditText, i need the correct input type. But! when i do

android:inputType="numberDecimal"

the soft keyboard it comes up with, is a soft keyboard without seperators, which mean i can't make commas. And it pretty much ruins the game :-) I have tried things like

android:inputType"numberSigned|numberDecimal"

i have also tried

android:digits="0123456789." but nothing worked so far.

I just can't get the right keyboard up.

Any suggestions?

like image 994
Tobias Jessen Avatar asked Aug 12 '12 10:08

Tobias Jessen


2 Answers

Try add comma ",". It may cause from different format of digits.

<EditText
    android:inputType="number"
    android:digits="0123456789.," />
like image 89
Lay Leangsros Avatar answered Oct 21 '22 21:10

Lay Leangsros


android:inputType="numberDecimal"

is for taking decimal inputs, so all the digits from 0 to 9 including the decimal point sign(.) only can be the input values. And it works fine. I don't understand where comma sign came into picture.

like image 8
Chandra Sekhar Avatar answered Oct 21 '22 21:10

Chandra Sekhar