currency rounding error
Using RB Enterprise 7.03 I have a list of currency values which
display properly rounded in a report. Using the a variable of
type sum though does not sum the rounded values but rounds the
final sum and is in error. For instance
5.957 rounds to 5.96 and 0.595 rounds to 0.60 (bankers rounding
0.5 to nearest even integer) so the sum should be £6.56. In fact
the sum shows as £6.55 (accurate (ie 6.552 rounds to 6.55) but
since the rounding has occurred in the items it is in error.
display properly rounded in a report. Using the a variable of
type sum though does not sum the rounded values but rounds the
final sum and is in error. For instance
5.957 rounds to 5.96 and 0.595 rounds to 0.60 (bankers rounding
0.5 to nearest even integer) so the sum should be £6.56. In fact
the sum shows as £6.55 (accurate (ie 6.552 rounds to 6.55) but
since the rounding has occurred in the items it is in error.
This discussion has been closed.
Comments
Please try downloading the latest version of ReportBuilder and test the
rounding with that. We have made a few changes to the way currencies are
handled since RB 7.03. You could also take a look at the
ppDisplayFormat.pas file for the logic we use to round currencies based on a
given display format.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
see RB7.04 for Delphi 5 but not for Delphi 6. What can I
donwload?