data changing when exporting into csv

hello all, i hope you can help, i tried everything:

I am currently using crystal reports 8.5 to abstract information from my sql server database, everything is running smoothly however when i export the report to a csv, the numbers change, but when i export it to any other format (excel, html) everything comes out correctly, however i need it to run in csv, can anyone help?

this is the code i am using for the field that change when i exported to csv:

shared numbervar total;
// {@minimumROP}

//if {@minimumROP} > total then
// {@minimumROP}
//else
// total

if {@minimumROP} > {@weightedAmount} then
{@minimumROP}
else
{@weightedAmount}

any help will be greatly apreciate it!!!
[785 byte] By [rsbutterfly16] at [2007-11-19 19:53:55]