New method & bug fix

- Added a method "lastCharIndex" to assist in the following bugfix:
- Fixed a bug where if the text string has just one decimal point,
anther decimal point cannot be added.
- Began work on the btnSwitch case in the switch statement.
Merge pull request #19 from jm-1013/master

Important bug fix and some new developments.