mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 20:15:41 +01:00
Update WebsiteMetricsBar.tsx
This commit is contained in:
parent
2a04809a91
commit
2660c44a6a
1 changed files with 7 additions and 3 deletions
|
|
@ -37,6 +37,7 @@ export function WebsiteMetricsBar({
|
|||
|
||||
const { pageviews, visitors, visits, bounces, totaltime } = data || {};
|
||||
const optionsNumber: FormatNumberOptions = { notation: 'compact', maximumSignificantDigits: 3 };
|
||||
const optionsSmallNumber: FormatNumberOptions = { notation: 'compact' };
|
||||
const optionsPercent: FormatNumberOptions = { style: 'percent' };
|
||||
|
||||
const metrics = data
|
||||
|
|
@ -45,19 +46,22 @@ export function WebsiteMetricsBar({
|
|||
...pageviews,
|
||||
label: formatMessage(labels.views),
|
||||
change: pageviews.value - pageviews.prev,
|
||||
formatValue: (n: number) => intl.formatNumber(+n, optionsNumber),
|
||||
formatValue: (n: number) =>
|
||||
intl.formatNumber(+n, +n < 100 ? optionsSmallNumber : optionsNumber),
|
||||
},
|
||||
{
|
||||
...visits,
|
||||
label: formatMessage(labels.visits),
|
||||
change: visits.value - visits.prev,
|
||||
formatValue: (n: number) => intl.formatNumber(+n, optionsNumber),
|
||||
formatValue: (n: number) =>
|
||||
intl.formatNumber(+n, +n < 100 ? optionsSmallNumber : optionsNumber),
|
||||
},
|
||||
{
|
||||
...visitors,
|
||||
label: formatMessage(labels.visitors),
|
||||
change: visitors.value - visitors.prev,
|
||||
formatValue: (n: number) => intl.formatNumber(+n, optionsNumber),
|
||||
formatValue: (n: number) =>
|
||||
intl.formatNumber(+n, +n < 100 ? optionsSmallNumber : optionsNumber),
|
||||
},
|
||||
{
|
||||
label: formatMessage(labels.bounceRate),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue