diff --git a/src/randomNotificationText.ts b/src/randomNotificationText.ts index b14a445..1b93855 100644 --- a/src/randomNotificationText.ts +++ b/src/randomNotificationText.ts @@ -218,21 +218,21 @@ const boosterFactorMessage : string[] = [ export function getRandomMessageWeeklyChallenge(points: number): string { const randomIndex = Math.floor(Math.random() * messagesWeeklyChallenge.length); const message = messagesWeeklyChallenge[randomIndex]; - return message.replace("[X]", points.toString()); + return message.replace("[X]", Math.round(points).toString()); } export function getRandomMessageTwoNoteChallenge(points: number): string { const randomIndex = Math.floor(Math.random() * twoNoteMessages.length); const message = twoNoteMessages[randomIndex]; - return message.replace("[X]", points.toString()); + return message.replace("[X]", Math.round(points).toString()); } export function getRandomMessagePoints(points: number): string { const randomIndex = Math.floor(Math.random() * randomPointNotices.length); const message = randomPointNotices[randomIndex]; - return message.replace("[X]", points.toString()); + return message.replace("[X]", Math.round(points).toString()); } export function getRandomMessageBoosterFactor(): string { diff --git a/src/view.ts b/src/view.ts index cdbca97..1211473 100644 --- a/src/view.ts +++ b/src/view.ts @@ -284,7 +284,7 @@ export class GamifiedPkmProfileView extends ItemView { updatePoints(newPoints: number) { const pointsValue = this.containerEl.querySelector('#points-value'); if (pointsValue) { - pointsValue.textContent = newPoints.toString(); + pointsValue.textContent = Math.round(newPoints).toString(); } }