calculator: fix comma bugs

- fix multiples of three e.g. 99+1
- fix case where separator is in the front e.g. *10000

Change-Id: I8eac28f2b14a2b0edf8e80d05f0f4ce909e2bc3d
Merge branch 'cm' into HEAD