Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How insert number (double) in EditText

I use this code

 <EditText
     android:id="@+id/price_for_liter_value_edit_text"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:background="@android:color/transparent"
     android:textColor="@color/dn_14_date"
     android:fontFamily="sans-serif-regular"
     android:textSize="18sp"
     android:text=""
     android:padding="4dp"
     android:inputType="number"/>

and at this line I set inputType:

  android:inputType="number"

but I cant enter double number (with . - like as 1.3 or 20.5). What type should I use in inputFormat ?

like image 324
Artem Avatar asked Sep 26 '14 09:09

Artem


Video Answer


1 Answers

You can use

  android:inputType="numberDecimal"
like image 187
Blackbelt Avatar answered Oct 18 '22 03:10

Blackbelt