I'm working in an Android application and i want to create a decimal mask for editText in android. I want a mask like a maskMoney jQuery plugin. But in some cases my number will have 2 decimal places, 3 decimal places or will be a integer. I want do something like this:
- When the EditText is created, come with a default value: 00.01
- If user press the number 2, the result should be: 00.12
- If user press the number 3, the result should be: 01.23
- If user press the number 4, the result should be: 12.34
- If user press the number 5, the result should be: 123.45
- If user press the number 6, the result should be: 1,234.56
What's the best way to do that?