fix: SW-981 Rounded to single decimal as current web

This commit is contained in:
Hrishikesh Vaipurkar
2024-11-22 18:51:11 +01:00
parent bd6fd62d5c
commit 21f9719050
6 changed files with 26 additions and 5 deletions

View File

@@ -0,0 +1,8 @@
/**
* Function to parse number with single decimal if any
* @param n
* @returns number in float type with single digit decimal if any
*/
export default function getSingleDecimal(n: Number | string) {
return parseFloat(Number(n).toFixed(1))
}