Show Battery Percentage in Status Bar Android 8 Oreo and 9 Pie
Please notice that there are many Android distrubutions and remixes. Some of them might have moved this settings to its own tweaking application like for example Resurrection Remix OS moved it to its own Configuration option is Settings.
Go to Settings
Tap on Battery percentage switch to enable it