SUM Aggregate Error?
Hi!
in fast report 3.07:
the result of my sum expresion memo is: 1.50015000E019
where is the problem? this is not a corect Aggregation!
I cheked Main Demo Exsample too....
in fast report 3.07:
the result of my sum expresion memo is: 1.50015000E019
where is the problem? this is not a corect Aggregation!
I cheked Main Demo Exsample too....
Comments
Said another way a computer has no way to store 1/3. At some point it does it's best but you are left with an ugly number.
You didn't say what type of data you are SUMing: floats, BCD or Currency. That can make a difference as well. And sometimes you have to round your results before you display them. 1.50015000E019 rounded to two decimal places will show 1.50.
Regards,
Django
My data in bank is String format numbers(numbers saved in String Fields)
but in the report I choosed %2.2n numerical display Formatting for it
but the respons is not Correct and Rounded....
please guide me step by step...
with best wishes & regards
majid
this is your problem
My data in bank is String format numbers(numbers saved in String Fields)
just as in delphi
you can't use numerical functions on string values.
if you looked closer at the demos which work fine you would see that the underlying datafields are of currency type
for example the nestedgroup group report
memo in footer contains
[Sum(<Sales."Qty">*<Sales."List Price">)]
since the fields are numeric the aggregate works fine.
if the fields were string fields
you would need to wrap each field with the function required to make them numeric
StrToFloat()
so
[Sum([StrToFloat(<Sales."Qty">)]*[StrToFloat(<Sales."List Price">)])]
would be correct.
you are right! this is a my programical problem....
But this problem works properly in fastreport 2.43!!!! and responses are corect!!!!
what is the difrent between 2.43 and 3.07 fastreport versions?