From 847d6244aab36418fc8bbcf47075da61668f4c35 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 25 Jul 2023 21:56:23 +0300 Subject: [PATCH] Convert formatCustomFormatScore to Typescript --- ...rmatCustomFormatScore.js => formatCustomFormatScore.ts} | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) rename frontend/src/Utilities/Number/{formatCustomFormatScore.js => formatCustomFormatScore.ts} (63%) diff --git a/frontend/src/Utilities/Number/formatCustomFormatScore.js b/frontend/src/Utilities/Number/formatCustomFormatScore.ts similarity index 63% rename from frontend/src/Utilities/Number/formatCustomFormatScore.js rename to frontend/src/Utilities/Number/formatCustomFormatScore.ts index 5effe511e..b4da3a2cd 100644 --- a/frontend/src/Utilities/Number/formatCustomFormatScore.js +++ b/frontend/src/Utilities/Number/formatCustomFormatScore.ts @@ -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' : '';