How do you store the number the user enters? If it's in a string and the previous value was eg "1" and the user enters "2" you get "12" with a simple concatenation: val += input.
OTOH, if you work with doubles and the previous value was 1.0 and the user enters 2.0 by pressing the button you get 12.0 by multiplying 1.0 with 10 and adding 2.0: val = 10*val + input.