i don't know why you are using the line:
view.numDisplay.selectRange(view.numDisplay.text.length, view.numDisplay.text.length);
but maybe you can change it to
view.numDisplay.selectRange(view.numDisplay.caretIndex, view.numDisplay.caretIndex);
to set the selection to the actual cursor position so your text won't be at the end but at the correct position.
Did you try without the line ? what problem do you try to correct with this ? With the standard behavior, the cursor is always after the last character typed. I don't understand why you want to force it to be at the end of the text.