Skip to content

Commit

Permalink
fix: use decimal correctly get correct floating point
Browse files Browse the repository at this point in the history
  • Loading branch information
EresDev committed Jul 31, 2024
1 parent 324234f commit 135105d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/parser/github-comment-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ export class GithubCommentModule implements Module {
<details>
<summary>
${Object.values(commentScore.score?.formatting?.content || {}).reduce((acc, curr) => {
const multiplier = new Decimal(
commentScore.score?.formatting
? commentScore.score.formatting.formattingMultiplier * commentScore.score.formatting.wordValue
: 0
);
const multiplier = commentScore.score?.formatting
? new Decimal(commentScore.score.formatting.formattingMultiplier).mul(
commentScore.score.formatting.wordValue
)
: new Decimal(0);
return acc.add(multiplier.mul(curr.score * curr.count));
}, new Decimal(0))}
</summary>
Expand Down

0 comments on commit 135105d

Please sign in to comment.