Hello,
Have you ever seen a text like "Ranked # 5,537 out of 88,675" on a website? I want to implement something like this for one of my websites.
I have a site that provides free polls for webmasters. Every time someone votes on a poll, I increase the field "popularity" with 1. So this field shows how many votes the poll is receiving and thus how popular this poll is. What I want to do is show the owners how popular their polls are. I want to do this with the text "Popularity: ranked # 5,537 out of 88,675".
But how can I do this? Fetching the 88,675 is easy. That just the number of polls in the database. But how do I calculate the 5,537?
Example:
=======
poll 1: popularity=34
poll 2: popularity=17
poll 3: popularity=16
poll 4: popularity=5
poll 5: popularity=60
Ranks:
=====
poll1: "Popularity: ranked # 2 out of 5".
poll2: "Popularity: ranked # 3 out of 5".
poll3: "Popularity: ranked # 4 out of 5".
poll4: "Popularity: ranked # 5 out of 5".
poll5: "Popularity: ranked # 1 out of 5".




Bookmarks