I need help converting the following Excel formula to Typescript. I keep running into an error that says 'The left-hand and right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type'. Can anyone assist me with this?
const result = ((inceptionDate) - 365.25 - referenceInceptionDate) / 365.25 + (riskFactor))
Just a heads up, both inceptionDate and referenceInceptionDate are Date objects.
I tried the following code and it seemed to work without any errors. Can someone confirm if this is the correct approach?
const result: number = ((inceptionDate.valueOf() - 365.25 - entry.referenceInceptionDate.valueOf()) / 365.25 + (riskFactor));
Thank you!