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

Incorrect number formatting in the mail template #4506

Open
2 tasks done
flipzoom opened this issue Sep 2, 2024 · 1 comment
Open
2 tasks done

Incorrect number formatting in the mail template #4506

flipzoom opened this issue Sep 2, 2024 · 1 comment
Labels
self-hosting Anything self-hosted

Comments

@flipzoom
Copy link

flipzoom commented Sep 2, 2024

Past Issues Searched

  • I have searched open and closed issues to make sure that the bug has not yet been reported

Issue is a Bug Report

  • This is a bug report and not a feature request, nor asking for self-hosted support

Using official Plausible Cloud hosting or self-hosting?

Self-hosting

Describe the bug

In the weekly and/or monthly report emails, number are not formatted correctly. The following example shows that the pageviews are stated as "11k" in the email, but the actual pageviews are "1.1k".

Expected behavior

Correct formatting of the numbers.

Screenshots

Mail report:
image

Real data:
image

Environment

Plausible CE: version 2.1.1

@ruslandoga ruslandoga added the self-hosting Anything self-hosted label Sep 2, 2024
@ruslandoga
Copy link
Contributor

ruslandoga commented Sep 2, 2024

👋 @flipzoom

Thank you for the report!

The formatting code used seems to be correct:

iex(2)> PlausibleWeb.StatsView.large_number_format 1100
"1.1k"
iex(3)> PlausibleWeb.StatsView.large_number_format 1100
"1.1k"
iex(4)> PlausibleWeb.StatsView.large_number_format 1090
"1k"
iex(5)> PlausibleWeb.StatsView.large_number_format 1200
"1.2k"

I think the problem might be with the query that gets the data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
self-hosting Anything self-hosted
Projects
None yet
Development

No branches or pull requests

2 participants