ragunathjawahar / android-saripaar

UI form validation library for Android
Apache License 2.0
3.22k stars 460 forks source link

Digit Annotation is very confusing. #191

Closed AlexCatch closed 7 years ago

AlexCatch commented 7 years ago

I can't seem to get the digits annotation to work, I can't figure out for the life of me what the integer parameter its wants is.

Entering numbers into the EditText causes validation to fail with 'Must be a digit'

This is my code.

    @NotEmpty
    @Order(value = 1)
    @Digits(integer = 2)
    @BindView(R.id.ageTextField)
    CoreEditText mAgeTextField;
ragunathjawahar commented 7 years ago

It is split into two parts integer and fraction. If you set @Digits(integer = 2, fraction = 2). These are all valid - 1, 1.1, 1.12, 23, 23.2, 23.25

malhobayyeb commented 7 years ago

What is the meaning of integer in this context?

Does it mean the length of integers?

ragunathjawahar commented 7 years ago

@malhobayyeb yes it does.