There seem to be a lot of different opinions on how to solve this issue, some easier to try out than other.
First of all, go into settings and turn off "show battery in percentage", then reboot the phone, recharge it and turn on "show battery in percentage".
Some say you need to calibrate the battery. This is done by fully discharging the phone, to the point where it turns off by itself. Then charge the phone to 100% and then discharging the phone again, without tuning the phone off for the entire period. However, I am not sure about the effectiveness of this method, but it is easy to try.
You could try and restore the phone to factory settings, to see if this elleviates the issue.
Now onto hardware issues.
If none of the above fixes solves the issue, you need to replace the battery. As you have the phone open, you can check for missing components around the battery connector - epscially the FL11 shown here:
Last resort would be to change the dock/charging connector.
Hopefully one of the points above will help you solve the problem.