Hard reboot the iPhone while it is plugged in after it shows the same percentage (98% or 99%) for more than 5 minutes. This "should" cause iOS to relearn the top of the charge. You might also then want to drain then iPhone to below 5% and then do one more full charge to make sure it is fully trained. You battery is probably fine, iOS on the other hand might be off on its low and top end readings and hence can't scale the battery life properly.