Quantcast
Viewing all articles
Browse latest Browse all 3636

Floating point rounding error in CR2011

Hi All,

 

I just upgraded our CrystalReports from 2008 to 2011, but I found there are some floating point rounding errors happened in the reports generated by the CR2011 (using "SAP Crystal Reports, developer version for Microsoft Visual Studio" libraries). The following is the example:

 

 

There is a field in my report (in fact, is a sub-report) to display (with 2 decimal points) the result output of my "sp_xxx;1.mLiab", and the following are its output values:

 

2008596.2770

1104305.8400

342524.3890

167207.5140

87253.0120

15414.4130

0.0000

 

And, there is another field in my report to display (with 2 decimal points) the sum up value of the output of my "sp_xxx;1.mLiab". The displayed value should be 3725301.45 in theory (as it is truncated from the actual summation output -> 3725301.445), but I found the CR2011 output me the wrong result 3725301.44. I have also tried to generated the same report by using CrystalReports 2008 and CrystalReports XI, and they also output me a correct value.


Does any one know what is the problem? Is it a bug? or, anything I configured in wrong way? Thanks in advance.


Cheers,

Elliott


Viewing all articles
Browse latest Browse all 3636

Trending Articles