feat: implement number precision parameter for stats card (#4514)

* Update short number format 

Update short number format by adding 2 decimal places instead of 1 for numbers between 1,000 and 9,999

* review

* Update src/common/utils.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* dev

* dev

---------

Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Lucas
2025-10-13 20:21:28 +03:00
committed by GitHub
co-authored by Copilot Alexandr
parent 7caaa21e73
commit 4143c6dec3
7 changed files with 85 additions and 11 deletions
+7
View File
@@ -416,6 +416,13 @@ describe("Test renderStatsCard", () => {
expect(getByTestId(document.body, "commits").textContent).toBe("2k");
document.body.innerHTML = renderStatsCard(stats, { number_format: "long" });
expect(getByTestId(document.body, "commits").textContent).toBe("1999");
document.body.innerHTML = renderStatsCard(stats, { number_precision: 2 });
expect(getByTestId(document.body, "commits").textContent).toBe("2.00k");
document.body.innerHTML = renderStatsCard(stats, {
number_format: "long",
number_precision: 2,
});
expect(getByTestId(document.body, "commits").textContent).toBe("1999");
});
it("should render default rank icon with level A+", () => {