I have an ASP page where I have 2 variables, strActualRate and strProposed. The values are:
strActualRate = 33.30
strProposed = 33.3
So when I write the following line to compare:
if strActualRate <> strProposed then Response.Writr 'Both are not equal!' end if
I am getting the output ‘Both are not equal’, even though both are the same. I am sure that I need to use some mathematical conversion function to compare.
Can anyone tell me how to solve this ?
Thanks in advance!
If I understand correctly, you think the two values are equal but because VBScript is comparing strings rather than numbers the two are coming back as not equal.
You’re correct in the conversion idea, and here’s the code:
That will convert your string values to numbers to do the comparison.