How To Replace "Sale" Tag With "Discount Percentage"? [Crave Theme]

Hello,

I want to change the “sale” tag on all the discounted products and display the “discount percentage” on the top of the product card.

I tried following editing the code by following the codes mentioned earlier in this community. But the code didn’t work as it belonged to other themes.

Someone please help me out with this.

Thanks for the solution. Worked beautifully for me. Just two small concerns:

1 - The percentage number that its showing is wrongly rounded off.. If a product is discounted to 49.9 percent, it is displaying as 49 and not 50. How to correctly round it off.

2 - How to display the same percentage on the product listing page too?

weblink: ananditnutrition.com
pwd: anandit