I have a function which adds zeros to a number: for example, we input 10, the output would be 10.00.
The issue is that the result of the function is a string rather than a number type, is there a way to return 10.00 as a number in javascript?
const formatNumber = number =>
number.toFixed(Math.max(((`${number}`).split('.')[1] || '').length, 2));