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

remove unnecessary number format in visit summary #15218

Merged
merged 2 commits into from Dec 9, 2019
Merged

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Dec 2, 2019

number formatting is meanwhile done somewhere else. For some local formats this second formatting breaks the numbers...

fixes #15200

@sgiehl sgiehl added the Needs Review PRs that need a code review label Dec 2, 2019
@sgiehl sgiehl added this to the 3.13.1 milestone Dec 2, 2019
@tsteur
Copy link
Member

tsteur commented Dec 2, 2019

@sgiehl
Copy link
Member Author

sgiehl commented Dec 2, 2019

I guess that is kind of expected. The generation time is a computed metric. But when no generation time has been tracked, the metric is not computed and thus the value is actually false. Because of that the metric won't get formatted in

if ($columnValue !== false) {
$row->setColumn($name, $metric->format($columnValue, $this));
}

But as the sparklines are using a number filter for the values it gets converted to 0 in
{% if '%s' in metric.description -%}
{{ metric.description|translate("<strong>"~metric.value|number(2)~"</strong>")|raw }}
{%- else %}
<strong>{{ metric.value|number(2) }}</strong> {{ metric.description }}
{%- endif %}{% if not loop.last %}, {% endif %}

@tsteur
Copy link
Member

tsteur commented Dec 2, 2019

OK might need to update the tests then 👍

@sgiehl
Copy link
Member Author

sgiehl commented Dec 9, 2019

tests are updated now

@sgiehl sgiehl removed their assignment Dec 9, 2019
@tsteur tsteur merged commit bcc315f into 3.x-dev Dec 9, 2019
@tsteur tsteur deleted the summarynbformat branch December 9, 2019 18:48
jonasgrilleres pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 22, 2020
* remove unnecessary number format in visit summary

* updates UI tests
jbuget pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 26, 2020
* remove unnecessary number format in visit summary

* updates UI tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect/corrupted number format in dashboards
2 participants