I am developing a banner ads system. Each banner will be stored in the db. Each banner will have a wight(int number). How can I transform that in percentage efficiently?
For ex:
banner_1 70 banner_2 90 banner_3 150
and I want to have banner 1 displayed 22% second 29% third 48%