Skip to content

Commit

Permalink
Merge pull request #7223 from google/enhancement/7190-format-KMW-tile…
Browse files Browse the repository at this point in the history
…-numbers

Format total values in KMW tiles.
  • Loading branch information
tofumatt authored Jun 28, 2023
2 parents 712004e + 75a0085 commit 133a689
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
MetricTileNumeric,
whenKeyMetricsWidgetVisible,
} from '../../../../components/KeyMetrics';
import { numFmt } from '../../../../util';

const { useSelect, useInViewSelect } = Data;

Expand Down Expand Up @@ -110,8 +111,8 @@ function LoyalVisitorsWidget( { Widget } ) {
metricValueFormat={ format }
subText={ sprintf(
/* translators: %d: Number of total visitors visiting the site. */
__( 'of %d total visitors', 'google-site-kit' ),
total
__( 'of %s total visitors', 'google-site-kit' ),
numFmt( total, { style: 'decimal' } )
) }
previousValue={ prevPercentage }
currentValue={ currentPercentage }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
MetricTileNumeric,
whenKeyMetricsWidgetVisible,
} from '../../../../components/KeyMetrics';
import { numFmt } from '../../../../util/i18n';

const { useSelect, useInViewSelect } = Data;

Expand Down Expand Up @@ -96,8 +97,8 @@ function NewVisitorsWidget( { Widget } ) {
metricValue={ newVisitors }
subText={ sprintf(
/* translators: %d: Number of total visitors visiting the site. */
__( 'of %d total visitors', 'google-site-kit' ),
total
__( 'of %s total visitors', 'google-site-kit' ),
numFmt( total, { style: 'decimal' } )
) }
previousValue={ prevTotal }
currentValue={ total }
Expand Down

0 comments on commit 133a689

Please sign in to comment.