crystal-reportscrystal-reports-2010

How to round field in SAP Crystal Report 2011?


Rounding of static value is different from rounding DB field value in SAP B1 crystal report 2011

I have 609,437.50 from Database when I go to Field Format and then round field I get 609,437

I have 609,437.50 in formula as static value when I round I get 609,438 which is correct same as excel

With decimal number picture

Without decimal number

How can I round Database field and get value like 609,438 while I have 609,437.50?

Please anyone can help me


Solution

  • You likely have database value different from xxx.50.

    What data type is your value in database - some float or decimal or money?

    If float, then you have to convert it to decimal first - float values are inexact and rounding may behave strangely.

    If decimal or money, then you may have more decimal places filled (like xxx.499), which rounds down again. You need either accept your results or round to two decimals first; this can be visually better, but is wrong mathematically.