Type number is not assignable to type "string"

I would use this to check and see what is the type of the variable. If it is a string you can convert it to a number then it should work

console.log(typeof totalPinCost);