Hi,
I am new to this forum, so hello to everyone.
I have written some vba code to check an xml file produced from a stocks app. This file is loaded via an API into our accounts and regularly fails the validation tests.
I copy the XML into the first column and then parse the values into the next one. I then replicate the checking mechanism by totalling values for the different vat rates and then when I reach the vat summary, I check the totals and this is where I have the issues. The accumulated VAT amounts are reached by multiply price by quantity by vat rate. Initially, I used single for my variables and this ended up with values such as 1.65000000045678 (example). I changed to doubles and the variables started to display correctly - 1.65. However, in some cases, the check fails even when the parsed value and the accumlated value are the same. The displays in the excel column look the same, I have converted the values to strings and the check then works. In the end I used the 'round to 2 decimal places' to get it to work.

My apologies for the long tome, but I reallu would like to know why two numeric values which appear to be the same fail the check.

Thanks

oggieben