Hello all,
I'm new with B4a so please bear with me. In my program the operator enter a value let say 2.65 in the edit text box, how can I extract the numerical value from the text to be able to use it in an equation?
Many thanks Erel,
So the if condition is just to make sure a numerical value is entered. I suppose the dot of 2.65 example will be taken as a fraction too.
Regards,
If the user is supposed to enter only numbers you should set EditText1.InputType = EditText1.INPUT_TYPE_DECIMAL_NUMBERS
to limit the authorized characters.
EDIT: changed INPUT_TYPE_NUMBERS to INPUT_TYPE_DECIMAL_NUMBERS
Many thanks Klaus,
So I will have to assign a value to input type number to INPUT_TYPE_NUMBERS ?
something like:
dim INPUT_TYPE_NUMBERS as int
INPUT_TYPE_NUMBERS = 4 'This should take care of the dot too for a value for example of 2.65?