9 lines
248 B
TypeScript
9 lines
248 B
TypeScript
/**
|
|
* 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))
|
|
}
|