WordPress.org

Making WordPress.org

Opened 5 years ago

Closed 5 years ago

#846 closed defect (fixed)

"downloads per day" decimal value

Reported by: shawnkhall Owned by: obenland
Milestone: Priority: low
Component: Theme Directory Keywords:
Cc:

Description

The "Downloads per day" "Total downloads" data item doesn't need to be a decimal. It's either a download or it's not, so "Total downloads: 16,531.00" doesn't make sense.

Attachments (1)

downloadsdecimal.png (19.1 KB) - added by shawnkhall 5 years ago.
demo for decimal value in download counter

Download all attachments as: .zip

Change History (11)

#1 @netweb
5 years ago

Where exactly are you seeing this? I see no reference to .00 for theme downloads on the themes page or an individual themes pages e.g:

#2 @dd32
5 years ago

This is most likely a bug report for https://wordpress.org/themesnew/ which I don't see it on either.

#3 @shawnkhall
5 years ago

It's for https://wordpress.org/themesnew/ -- you can see it by clicking any "more info" link then scrolling down to the Downloads Per Day section. I've attached a sample ("Bold Headline" theme v1.3.3).

@shawnkhall
5 years ago

demo for decimal value in download counter

#4 @shawnkhall
5 years ago

Hm. Looks like it's only happening in Internet Explorer 10.

#5 @dd32
5 years ago

It looks like this is a locale thing, for example I see this:
https://cloudup.com/cYz23jOlTMt

Note that there's no decimal, and the date format on the graph is different

#6 @shawnkhall
5 years ago

@dd32 -- is your screenshot from IE 10? I don't see the problem in IE 11, Firefox or Chrome, but it is definitely present in IE 10.

#7 @dd32
5 years ago

Sorry, that was Chrome on Mac. This is most definitely related to the Browser locale code, as it's the same Javascript which is doing it on each browser.

This seems to explain why:
http://stackoverflow.com/questions/21536984/javascript-format-whole-numbers-using-tolocalestring

I'm tempted to suggest just leaving it be, although IE 6~10 would be affected by it, looking at our analytics, that would mean 1% of visitors would be affected by it (Approx 4% of the traffic to /themes/ is IE, of which 75% is IE11, and only increasing), how many of them would then care/look at the number seems minuscule to me.

Last edited 5 years ago by dd32 (previous) (diff)

#8 @shawnkhall
5 years ago

I agree. As of January 2016 MS will no longer support any version of IE except the latest on supported OSes, which means IE11 will be the lowest supported on Win7, finally forcing me to abandon DQSD.
http://blogs.msdn.com/b/ie/archive/2014/08/07/stay-up-to-date-with-internet-explorer.aspx

#9 @obenland
5 years ago

Yes, as Dion mentioned, browsers render localized numbers pretty inconsistently unfortunately. Safari (including iOS) doesn't do anything with it at all, and just returns the integer for example.

We could of course throw another JS library at it, but that feels a littler over the top.

Browser support: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString#Browser_compatibility

#10 @obenland
5 years ago

  • Owner set to obenland
  • Resolution set to fixed
  • Status changed from new to closed

In 1278:

WP.org Themes: Consistent number formatting across browsers for download counts.

Filters the data coming in from the API, rather than manipulating it on the
front-end.

Fixes #846.

Note: See TracTickets for help on using tickets.