Wish Numeric Input Edit

gdeppi

Member
Licensed User
Longtime User
It would be really nice to develop a Numeric Input Edit to input of any numeric type (integer, float, number of decimals, formatted or not input), without the need to add as many checks in code.

Regards,

Giuseppe
 

eurojam

Well-Known Member
Licensed User
Longtime User
but you can already set the inputtype to numbers or decimals:
B4X:
EditText1.InputType = EditText1.INPUT_TYPE_DECIMAL_NUMBERS
 

gdeppi

Member
Licensed User
Longtime User
Ok, but I can't control the decimal separator type, the lenght of decimals and so on ...
 

Mahares

Expert
Licensed User
Longtime User
If you do not mind working with the input box, then the Dialogs library offers that. Example:
B4X:
Dim nd As NumberDialog  'number of digits, default, numb of dec., dec. charact., etc.
nd.Digits = 5 :nd.Number = 0 :nd.Decimal = 2 :nd.DecimalChar=Chr(44)
 

gdeppi

Member
Licensed User
Longtime User

Ok, but I want to input numbers directly on the input box with all options You mentioned here.

I have already prepared same routines that control the input and format the numbers entered with all the above options, to be included in Sub _TextChanged and _FocusChanged, but I must repeat for each inputbox I declare.
The ideal would be to have a new control, or to extend the inputbox with these routines, but I not know how to do that...
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…