19

The count of helpful flags on the user profile page doesn't use a thousand separator. There are other areas like that, I know, but this one stands out much more as it's right next to the profile views count which uses the separator.

enter image description here

I know this is small but I guess won't be hard to change.

  • 6
      is the one true thousands seperator! U+2009 2014. – Ry- Mar 2 '14 at 23:31
  • 4
    This seems to be fixed now, as part of the general user profile overhaul. – Ilmari Karonen Jul 16 '15 at 21:01
  • 1
    @IlmariKaronen That's correct. Put that as an answer and I'll accept it to let everyone know it's done. – Szymon Jul 17 '15 at 4:09
7

I've added a client-side fix for this issue into the Stack Overflow Unofficial Patch v1.10. Alas, I have not been able to test it fully under "natural" conditions, since I don't actually have a four-digit helpful flag count on any SE site, but it does work as expected if I kluge it to artificially inflate the count.

In case you're curious, here's the code:

var links = $('body.user-page #user-info-container a[href^="/users/flag-summary/"]');
SOUP.forEachTextNode( links, function () {
    this.nodeValue = this.nodeValue.replace( /[0-9]{4,}/g, function (digits) {
        return Number( digits ).toLocaleString( 'en-US' );
    } );
} );

Note that, since the fix is based on Number.toLocaleString(), some older browsers might format the number according to the user's selected locale. All officially supported browsers should respect the explicit en-US locale I'm specifying, though.

Edit: It seems the original fix caused some minor formatting breakage for moderators. SOUP v1.10.2 uses the updated code above, which should be more tolerant of the link(s) containing more than just a simple number. Thanks to Monica Cellio for reporting this issue!

Update: As of mid-2015, it seems that this issue has been quietly fixed at some point, presumably as part of the general user profile overhaul carried out in spring. The client-side hack described above will thus be retired from the next release of SOUP.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged .