I'm trying to make a calculation functions that take a string value converts it into a float with 2 decimal points then calculate it by increasing the original value by 10% and then return it as a string. However I'm getting the return value incorrectly.
function updatePoints(points: string):string{
const intPoints = parseFloat(points).toFixed(2)
const totalPoints = (((+intPoints/100)*10)+intPoints)
console.log(totalPoints)
return totalPoints
}
if i input 1000, I'm expecting a value to return 1100. However I'm getting 1001000.00, which are added up with 2 strings instead.