Forum Discussion

gid_216's avatar
Frequent Contributor
12 years ago

Data Comparision Error


In an aplication, while validating the total from a Microsoft DataGridView, at the end when I am trying to campare using

"If CDbl(XXXXX)=CDbl(YYYYY) Then"

It fails even if the data are same. but If I follow

"If CStr(CDbl(XXXXX))=CStr(CDbl(YYYYY) )Then"

then it pass. This scenario is tested for the decimal values. please tell me waht to do to validate them without converting to String. Here the values are updating when CDbl is used like changing from 8542.30 to 8542.3 etc.



2 Replies

  • TanyaYatskovska's avatar
    SmartBear Alumni (Retired)

    Hi Deepak,


    The CDbl function works fine in TestComplete 9.20 installed on my computer. What TC version are you using? Try using the aqConvert.StrToFloat method to convert your data and compare it.


  • gid_216's avatar
    Frequent Contributor
    Dear Tanya,

    I am using TC 9.10. Let me try installing TC 9. 20.