Regarding the calculated results of CInt function

Hi, I am a UiPath beginner as well as UiPath Studio EnterPrise verion 23.4.2 user.
I am using For Each Row activity.
If the value of row(“number of oranges”) are assigned as followings,
What are the calculated results of CInt(row(“number of oranges”).ToString ??

Case1: value of row(“number of oranges”)=3.3
Case2: value of row(“number of oranges”)=3.5
Case3: value of row(“number of oranges”)=3.7

Hi @gorby

You are changing the String format to Cint

CInt(row(“number of oranges”).ToString )

If you want to change it to String follow this

row(“number of oranges”).ToString

If you want to change it to Int follow this

Cint(row(“number of oranges”))

If you want to check the condition with 3.5,3.6,3.7 these are the decimals you double.
Cdbl(row(“number of oranges”))=3.3
Cdbl(row(“number of oranges”))=3.5
Cdbl(row(“number of oranges”))=3.7

Hope it helps!!

Hi,

it will return as the following.

Case1 : 3
Case2: 4
Case3 : 4

Please note that it works like Math.Round(Double.Parse(strDouble)) . the following document will help your understanding deeply.

Regards,

Hi @gorby

Convert.ToInt32(Math.Round(Convert.ToDouble(row(“number of oranges”))))

Sorry, but I could not understand why you gave me this answer to my question…
Hope you re-read my question or pls refrain from answering if you are teasing me.

Regards,
Gorby

Sorry, but I could not understand why you gave me this answer to my question…
Hope you re-read my question or pls refrain from answering if you are teasing me.

Regards,
Gorby

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