fix: SW-981 Rounded to single decimal as current web
This commit is contained in:
8
utils/numberFormatting.ts
Normal file
8
utils/numberFormatting.ts
Normal 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))
|
||||
}
|
||||
Reference in New Issue
Block a user