I found that marking What is your best programmer joke? 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 Hidden Features of C#?
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:
score = parseInt($('#favorite_count').text(), 10); $('#favorite_count').text(score-1);
What is happening is the `parseInt' sees the comma, and then stops reading the number. Therefore truncating it to 1.
1+1 = 2
1-1 = 0
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.