Option Strict On disallows implicit conversions from 'Double' to 'Integer'

Hello,
I’ve created three variables namely cnt, currPage, and lastPage. Their variable type is set to Int32. When I try to divide it using Assign Activity

I get this error: Compiler error(s) encountered processing expression “lastPage/currPage”. Option Strict On disallows implicit conversion from ‘Double’ to ‘Integer’
image

Take note that I set my variables as integer

1 Like

you can try this
use write line
math.Round(lastPage/currPage)

Does that mean I have to change the quotient’s variable to string?

1 Like

you can try this math.Round( lastPage/currPage)
@hoylinet

I need the quotient’s variable for my next activity, it will serve as the limit of my iteration

division.xaml (5.0 KB)
check this workflow!
cheers
@hoylinet

2 Likes

Hey! Thanks, it works.

2 Likes

The division done here would result in a double (with decimal), while the variable you are trying to assign to is an Integer. It can either be cast to an Int and truncate the result, or use Round().

1 Like

Close this thread by marking it as a soultion @hoylinet

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.