EditText Decimal is custom EditText for show decimal with comma(,) and validation of precision & scale
##Component
th.in.lordgift.widget.EditTextDecimal
- Decimal with floating point validation.th.in.lordgift.widget.EditTextIntegerComma
- Integer format with comma(,) and validate numberLength becausemaxLenghtcount comma(,).th.in.lordgift.widget.EditTextDecimalComma
- mix of above.th.in.lordgift.widget.EditTextCard
- validate idCard format with hyphen(-)
##Installation
Add dependency to your build.gradle
compile 'th.in.lordgift:edittextdecimal:1.2'
##Usage
Please see the demo module
- Add namespace to your top-level layout XML
xmlns:app="http://schemas.android.com/apk/res-auto"
- Add components to layout somewhere
<th.in.lordgift.widget.EditTextDecimalComma
android:id="@+id/editText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="12,345.67"
app:precision="10"
app:scale="2" />
precision
- limit all digit included scaleEditTextDecimalComma
&EditTextDecimalComma
scale
- limit digit after point(.)EditTextDecimalComma
&EditTextDecimalComma
numberLength
- limit all digit without comma forEditTextIntegerComma
cardType
- can only use idCard that is thai id-card format & validation
*DO NOT FORGET SET ATTRIBUTES FOR COMPONENT, please CTRL+SPACE
- getValue() to get real value without comma(,) and hyphen(-)