Skip to content

Commit

Permalink
src/core/elements: Convert ranking to en-US locale format
Browse files Browse the repository at this point in the history
Convert 123456 to 123,456 to make it more logical while viewing.

Signed-off-by: Panchajanya1999 <[email protected]>
  • Loading branch information
Panchajanya1999 committed Oct 30, 2023
1 parent 9d1032d commit fbbb073
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,11 @@ export function Username(username: string, site: string) {
}

export function Ranking(ranking: number) {
const formattedRanking = ranking.toLocaleString("en-US");

const item = new Item("text", {
id: "ranking",
content: "#" + (ranking.toString()),
content: "# " + formattedRanking,
style: {
transform: "translate(480px, 40px)",
fill: "var(--text-1)",
Expand All @@ -131,6 +133,7 @@ export function Ranking(ranking: number) {
return item;
}


export function TotalSolved(total: number, solved: number) {
return new Item("g", {
id: "total-solved",
Expand Down

0 comments on commit fbbb073

Please sign in to comment.