All-
I am working on an app in which the user enters the bill cost the tip rate. I know how to take the values of the edittext fields and preform the necessary math on them, but on the tip rate field I have to add a decimal point in front of the entered numbers. So if the user inputs “2” it shows up in the java code as “.2”. Is there a way to do this?
Thanks in advanced!
All- I am working on an app in which the user enters the bill
Share
Simple –
If you want a dot between the characters, just divide it by 10^(length).
So if the entered string is 2, divide by 10. If its 22, divide by 100.
Other alternative would be –