SSD1306 display.clearDisplay()

So if I understand correctly you just want to clear the encoderPos ?

Do you have a problem when for example value is '987', and then the next value is '2' and you see on the display '982', the '98' from the previous value, that's what you want to erase, correct?