Hi,
You need to convert it to a number using the parseInt or parseFloat functions, or simply use the Unary plus(+) operator.
How to do Division in Office Scripts
Karthik Mahendrakumar
1
Reputation point
Hello Guys. I want to do division in the Office Scripts.
Eg: salary_nl = ( fixed_salary ) / 12
But I am getting error at line 24 as you see in the below image. How to resolve this ?
Microsoft Office Online Server
Microsoft Office Online Server
Microsoft on-premises server product that runs Office Online. Previously known as Office Web Apps Server.
690 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,364 questions
2 answers
Sort by: Most helpful
-
kinuasa 371 Reputation points
2021-10-27T07:24:37.44+00:00 -
Nancy Wang 116 Reputation points Microsoft Employee
2021-11-19T21:01:21.683+00:00 @kinuasa 's suggestion sounds right - another way you may be able to fix this error is by modifying line 23 to read "let fixed_salary = tablevalues[i][11] as number;". This lets the code know to expect a number value for your variable, fixed_salary, so that you can divide it in the next line to calculate salary_nl. I hope this helps!
Nancy