Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Commit

Permalink
fix + and -
Browse files Browse the repository at this point in the history
  • Loading branch information
SophiaH67 committed Jul 31, 2023
1 parent 0e0ae36 commit 76275ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/check/rules/goodChina.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ export default async function goodChina({
const socialCreditChange = Math.round(
(amountOfPositivity * 40 - 10) * (Math.random() + 1),
);
return [`好公民! +${socialCreditChange}社会信用。`, socialCreditChange];
return [
`好公民! ${
socialCreditChange > 0 ? '+' : ''
}${socialCreditChange}社会信用。`,
socialCreditChange,
];
}

export const getAmountOfPositivity = (sentence: string) =>
Expand Down

0 comments on commit 76275ee

Please sign in to comment.