Hello,
i need to devide to cell values and need to do mu;tiplication by 100.
here i geed to get 185 and 185
and need to do (187/185)*100
when i am doing this , result is showing 100 but correct value is 98.9 which i need to compare with excel field shown in image.
i am using int variable to get values and genericvalue type for devide and multiplication like below
i need to avoid round off or wrng value.
help me on same.
my required ou is 98.9
vhvinodsai
(Vinod harapanahalli )
April 21, 2025, 1:26pm
2
Hi @Mathkar_kunal here you can use decimal or double instead of integer than you will get output. Try this hope it finds well
still giving same output
change v1,v2 variable type to double and final variable type keep same as generic tpe and that too checked by changing double
but same output
100
Mathkar_kunal:
(187/185)*100
Hi @Mathkar_kunal
Please try to correct Variable types,
If you found helpful, feel free to tick as a solution.
Happy Automation
mkankatala
(Mahesh Kankatala)
April 21, 2025, 2:09pm
5
Hi @Mathkar_kunal
Try the below expression in assign activity,
(Cdbl(V1)/Cdbl(V2))*100
Make sure Final Variable is in System.double datatype.
Hope it helps!!
mkankatala
(Mahesh Kankatala)
April 21, 2025, 2:39pm
7
Okay @Mathkar_kunal
Try this one it’s working,
Math.Round((Cdbl(V1)/Cdbl(V2))*100, 2)
Happy Automation!!
@Mathkar_kunal
Can you debug and check the value of V1 and V2 that it is 185 and 187 ? just put a breakpoint before assigning the final
postwick
(Paul Ostwick)
April 21, 2025, 3:20pm
10
You shouldn’t be using GenericValue as a datatype. Use proper datatypes like Single, Double, Decimal, Int32, Int64, etc.
@Mathkar_kunal
Did you try solution given by @prashant1603765 ?
1 Like
system
(system)
Closed
April 25, 2025, 7:16am
15
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.