I found that marking http://stackoverflow.com/questions/234075/what-is-your-best-programmer-joke-closed as a favorite removes the number of people having set it as a favorite and resets it to 2, and subsequently unmarking it will set the number to 1. Refreshing the page with it marked shows the proper number again, but then unmarking it as a favorite will set the number to 0 marking it as a favorite again at this point changes the number to 1. This seems to hold true for other high favorited counts as well, such as http://stackoverflow.com/questions/9033/hidden-features-of-c
What is meta?
- Any Stack Exchange user can ask a question
- The community provides support, votes on ideas, and reports bugs
- Your voice helps shape the way Stack Exchange operates
My guess is it has something to do with adding or subtracting 1 from the number.
When creating a greasemonkey script, I ran into the problem with the formating of numbers, as they use
I ended up having to create a function that would translate StackOverflow numbers into regular parse-able numbers.
In jQuery, the function that updates the count is probably something like this:
What is happening is the `parseInt' sees the comma, and then stops reading the number. Therefore truncating it to 1.
Following that logic, any question with 2,000 favorites will show 3 when you favorite it, and 1 when you unfavorite it.
The only reason we haven't figured this out till now is because there really hasn't been that many questions that get 1,000+ favorites, and we mostly deal with 1s, 10s, and 100s. All three of these do not have any special formating, and therefore have worked.
The problem is that you would have to parse the number, make a modification, and then reformat it, and then display it.
Rounding error. Favorite counts are stored as a 3 bit floating point number.
Don't ask why, just accept it and move on.