Convert formatCustomFormatScore to Typescript

This commit is contained in:
Bogdan 2023-07-25 21:56:23 +03:00
parent 8fd8128641
commit 847d6244aa
1 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,7 @@
function formatCustomFormatScore(input, customFormatsLength = 0) {
function formatCustomFormatScore(
input?: number,
customFormatsLength = 0
): string {
const score = Number(input);
if (score > 0) {
@ -6,7 +9,7 @@ function formatCustomFormatScore(input, customFormatsLength = 0) {
}
if (score < 0) {
return score;
return `${score}`;
}
return customFormatsLength > 0 ? '+0' : '';