Michaeljep
(Michael Jeppesen)
February 19, 2020, 10:17am
1
Hi,
I think I have tried about anything except the solution.
I retrieve two string variables, one that might be a decimal number and one that always will be a decimal number.
The easy solution is to do an true/false on String=String, but with the decimals is always false.
I have tried Math.Round - Convert to Int - Convert to Double and Convert.ToDecimal, but none of them gives me the possibility to compare the two numbers.
3012,00 - 3012 should equal 0, but converting the numbers gives 301200 - 3012 = 298188 which is incorrect. I just want to verify that the two variables deducted is less than 1.
karthick
(Karthick)
February 19, 2020, 10:21am
2
Convert both sides to Decimal or Double and perform your actions. it will work
Michaeljep
(Michael Jeppesen)
February 19, 2020, 10:29am
3
I have already tried Cdbl on both values, but that gives me 301200 and 3012 which is not correct.
TimK
(Tim Kok)
February 19, 2020, 10:30am
4
Convert the , in the value to a . first then try to convert to decimal
karthick
(Karthick)
February 19, 2020, 10:35am
5
replace the value of , to . and then perform
Michaeljep
(Michael Jeppesen)
February 19, 2020, 12:44pm
6
Replacing the , did the trick. Now I get the wanted solution.
Thanks for the help.
system
(system)
Closed
February 22, 2020, 12:50pm
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.