Custom progress bar

Actually I want to make a battery progress bar.

But I want the corners of the progress to be rounded

So please tell me a formula to put into the calculator box