How to Read value from datatable then apply multiplication or division on the value

Hi everyone,

I am trying to take value from a specific datatable cell and then divide it by 2. The outcome will be typed into a field using typeinto activity.

here is what I tried so far and failed -

“(Masterform.rows(23)(0).todouble)/2” - in a messagebox, this come up as text

“(Masterform.rows(23)(0)/2” - this results in a decimal number 0.4105, i couldn’t relate this to anything.

Please could anyone help?

Hi @bokapakhi,
are you using the double quotes mentioned in these lines:

“(Masterform.rows(23)(0).todouble)/2” - in a messagebox, this come up as text
“(Masterform.rows(23)(0)/2” - this results in a decimal number 0.4105, i couldn’t relate this to anything.

is this (0.4105) the correct answer?

Try CInt(Masterform.Rows(23)(0).ToString)/2

Hi @sanjayshaswani - yes I have used the double quote. The value in that cell is 350, so the answer should be 175. I’m not sure about that 0.4105

@Karthick_Settu I have tried using this in a messagebox. But it says it disallowed implicit converstion from double to string

In message box use like this (CInt(Masterform.Rows(23)(0).ToString)/2).ToString

1 Like

That worked perfectly @Karthick_Settu thank you very much all for helping

1 Like

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