Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format numbers displayed in Piwik reports (eg. 1,000,000 instead of 1000000) #1254

Closed
mattab opened this issue Mar 29, 2010 · 7 comments
Closed
Assignees
Labels
c: Usability For issues that let users achieve a defined goal more effectively or efficiently. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Mar 29, 2010

Piwik displays a lot of numbers, in graphs, tables, overview reports, etc.

Depending on your country, a number is displayed differently.
For example

  • US: 5,000.34
  • EU: 5 000,34

The translation file could contain a NumberFormat entry that would define:

  • the thousands separator
  • the decimal separator

See function http://php.net/number_format

The current behavior is a mix: the graphs show US formats, while the tables and overviews don't have any specific style applied.

Every number output in Piwik would have to go through the same helper function, that would apply the translation formatting preference.

Maybe we could use some sort of Smarty magic helper functions to automatically apply the styles to numbers, the same way it currently does add the ?piwik=0.5.5 parameter as cache burster parameter?

Setting milestone as 1.0, but this might not make it if we need to update all templates to add the smarty modifier call to each number printed.

@mattab
Copy link
Member Author

mattab commented Dec 14, 2012

From #3154:

Piwik::getPrettyNumber, which turns 1000000 into 1,000,000 or 1.000.000 should be used on every numeric value in Piwik to make report data more readable. I think this can be done by:

  • Modifying existing prettify-ing functions so they make use of Piwik::getPrettyNumber.
  • Creating a generic DataTable filter that applies getPrettyNumber to metrics that have no unit (ie, visits). Would have to be applied by ViewDataTable, not the API.

Should probably be done after widget integration testing is up and running.

@mattab
Copy link
Member Author

mattab commented Dec 14, 2012

Also duplicates #2773

@mattab mattab added this to the Future releases milestone Jul 8, 2014
@mattab mattab removed the P: normal label Aug 3, 2014
@zawadzinski
Copy link
Contributor

Can we prioritise this issue? Thousands and millions separators are really important as right now it's very easy to make a mistake e.g. between 10000000 page views and 100000000 page views when we discuss traffic numbers with potential clients.

@sgiehl
Copy link
Member

sgiehl commented Sep 12, 2015 via email

@mattab mattab modified the milestones: 3.0.0, Long term Sep 14, 2015
@mattab mattab added Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. c: Usability For issues that let users achieve a defined goal more effectively or efficiently. and removed Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. labels Sep 14, 2015
@mattab
Copy link
Member Author

mattab commented Sep 14, 2015

@zawadzinski Good point - this feature is a must-have! adding to 3.0.0 at least, but let's also consider whether this could be done earlier in our LTS 2.X version.

@sgiehl

  • waiting for 3.0.0 in general can be a bit challenging, because it won't be ready until next year sometime (not defined yet)
  • maybe we could import the relevant Intl translation points in 2.X

Where should number formatting be applied at minimum (MVP)?

  • All websites dashboard
  • in all data table reports
  • in all graphs
  • in overview reports (eg. next to sparklines)

Optionally in:

if it could be done "relatively quickly" this would be very worth doing! @sgiehl maybe you have some time to investigate this in coming few weeks, if not let me know, thanks

@sgiehl sgiehl self-assigned this Sep 22, 2015
@sgiehl
Copy link
Member

sgiehl commented Sep 22, 2015

I'm currently having a look at that.
I will also include the changes done to date and time formats, which were already merged to 3.0 branch. Otherwise it might result in too many merge conflicts later.

I'm almost finished with importing the required data from CLDR, but using those within Piwik might be a bit more challenging...

@mattab mattab modified the milestones: 2.15.0, 3.0.0 Sep 23, 2015
@mattab
Copy link
Member Author

mattab commented Oct 11, 2015

Great news: implemented in 2.15.0 in #8857

@mattab mattab closed this as completed Oct 11, 2015
@mattab mattab changed the title Add "number format" in translations Format numbers displayed in Piwik reports (eg. 1,000,000 instead of 1000000) Oct 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Usability For issues that let users achieve a defined goal more effectively or efficiently. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

3 participants