Total : wrong number of decimals after soustraction of total
Domi
Belgium
Hi,
I have 2 columns from a ms access datatase (the fields are 'numbers' with 2 decimals places),
I make a summation of these columns and I substract one total value from the other;
althought the difference must be zero, it gives me 0.00114250 ....
how is this possible and, most over, how to fix it ?
thanks in advance,
Domi.
I have 2 columns from a ms access datatase (the fields are 'numbers' with 2 decimals places),
I make a summation of these columns and I substract one total value from the other;
althought the difference must be zero, it gives me 0.00114250 ....
how is this possible and, most over, how to fix it ?
thanks in advance,
Domi.
Comments
2. what datatype you're using? float, double, decimal? float is less precision
3. make sure that you've 2 decimal places in the msaccess data, what kind of field type?
?°) I'm calling msacces directly from fastreport (except that I pass the connection string thru the 'parameters')
?°) i'm using Number ('double' with 2 decimal places)
here is a screenshot of the msaccess designer for the fields.
thanks for trying to help me,
sincerly,
Domi.
msaccess => use currency datatype
mssql => use money datatype
why?
https://stackoverflow.com/questions/2144627...access-database
http://csharpindepth.com/Articles/General/FloatingPoint.aspx
http://www.extremeoptimization.com/resourc...AndFormats.aspx
make sure debit and credit with 'System.Decimal' datatype
yes a refresh was made, removed completely the DB and add it back to be sure
here is the def :
BUT
I have added 'Format="Currency"' in the xml :
and the format is like expected which is strange because the TextObject doesn't contain only numbers but also text : "Solde : TotalDebit]-[TotalCredit"
you may check with creating 'running sum' with code.
use currency formatting only if solved
Domi.