Skip to content

Commit

Permalink
feat: multiply season points by 100 to remove decimal places (#193)
Browse files Browse the repository at this point in the history
* feat: multiply season points by 100 to remove decimal places

* chore: fix tests

* chore: update action to node 22

* allow compiling
  • Loading branch information
wopian authored Apr 25, 2024
1 parent 8bb668c commit 8621f69
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

env:
FORCE_COLOR: true
NODE_VERSION: 18
NODE_VERSION: 22

jobs:
setup:
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,12 @@
},
"ava": {
"utilizeParallelBuilds": true,
"extensions": {
"ts": "module"
},
"nodeArguments": [
"--loader",
"tsx"
]
"typescript": {
"rewritePaths": {
"src/": "dist/"
},
"compile": "tsc"
}
},
"c8": {
"all": true,
Expand Down
17 changes: 9 additions & 8 deletions src/utils/handleEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,15 @@ export const handleEvents = (
JSON.stringify(
[...seasonUsers]
.sort((a, b) => b[1].totalPoints - a[1].totalPoints)
.map(
([steamId, user]) =>
({
...user,
steamId,
totalPoints: Number(user.totalPoints.toFixed(2))
} as UserStanding)
),
.map(([steamId, user]) => {
const totalPoints = Number((user.totalPoints * 100).toFixed(0))

return {
...user,
steamId,
totalPoints
} as UserStanding
}),
undefined,
2
)
Expand Down

0 comments on commit 8621f69

Please sign in to comment.