Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Change formatCount impl to use Intl.NumberFormat #11379

Merged
merged 2 commits into from
Aug 8, 2023

Conversation

germain-gg
Copy link
Contributor

@germain-gg germain-gg commented Aug 8, 2023

For element-hq/element-web#25892

Checklist

  • Tests written for new code (and old code if feasible)
  • Linter and other CI checks pass
  • Sign-off given on the changes (see CONTRIBUTING.md)

This change is marked as an internal change (Task), so will not be included in the changelog.

Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

// it in every function call
const compactFormatter = new Intl.NumberFormat(locale, {
notation: "compact",
});

/**
* formats numbers to fit into ~3 characters, suitable for badge counts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth updating the comment to say it also rounds, as shown by the example

@germain-gg germain-gg added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label Aug 8, 2023
@germain-gg germain-gg enabled auto-merge August 8, 2023 11:20
@germain-gg germain-gg added this pull request to the merge queue Aug 8, 2023
Merged via the queue into develop with commit 84d1967 Aug 8, 2023
@germain-gg germain-gg deleted the gsouquet/update-format-count branch August 8, 2023 12:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants