What you need to do deadly is hold the lock button and the home button until the apple logo comes up (do this while the phone is off) this will reset the phone - the counter for your battery percentage my have not started up correctly as it's best described as an internal app. Also, turn your phone off AFTER plugging it in, iPhones that are off have a tendency to turn on when plugged in. Leave it off and plugged in for approximately 45 minutes, turn on the phone by holding the lock and home buttons - your phone should stay on until at least 5 percent after this reset and jump start.
Also, keep in mind that smartphone batteries are also "smart" if you constantly plug in your phone at 20 percent - 20 percent will register as your new 0 percent.
Also, it's good to do a "tune up" of your battery at least once a month, and by that I mean going through a whole life cycle. Keep your phone on until it dies - and keep turning it back on until the phone will not turn back on anymore - this will insure that your battery is fully drained - you may have to turn it on with the "reset" method if your percent counter is really screwed up.
Once your phone tells you that it cannot turn on unless it is plugged in, plug it in and then turn it off (if it turns on of course) and leave it for a good 3 hours - even if you have the power charger.
After that it should be good as new ️