Files
shields/services/chrome-web-store
TheConfax 4aa38bdd5f [ChromeWebStoreUsers] Fix 1M+ counts rendering as "12000,000" not "12M" (#12028)
* [ChromeWebStoreUsers] Fix 1M+ counts rendering as "12000,000" not "12M"

The Chrome Web Store reports counts with thousands separators, e.g.
"12,000,000". The handler stripped them with a string argument to
String.prototype.replace, which only removes the first match, leaving
"12000,000". metric() then coerced that to NaN and printed it verbatim.
Counts below 1M have a single separator, so they were unaffected.

Use a global regex so every separator is removed, and extract the logic
into a testable static transform() (mirroring ChromeWebStoreSize) with
deterministic unit tests for the millions case.

* [ChromeWebStoreUsers] Address review: use replaceAll, drop redundant metric test
2026-07-21 08:32:55 +00:00
..