SAP Knowledge Base Article - Public

3082571 - How To: Crystal Reports - format a Currency field with multiple decimal places in the same column without trailing zero's

Symptom

We have a report that can show multiple currencies in the same column, some may have use 2 decimals and some may use 3 decimals.

We want to be able to show them in the same column.

Environment

  • Crystal Reports - all versions
  • Crystal Reports for Visual Studio .NET all versions
  • Crystal Reports Java SDK - all versions 

Resolution

See attached report and Excel data source to test.

Formatting formula looks like this:

if truncate({Command.Tax Amount},3)-{Command.Tax Amount}<0 then 3 else 2

Note: the column will no longer line up so set the Rounding to the maximum so it does not alter the value.

Keywords

 CR, Formatting, dynamic decimal places , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To

Product

SAP Crystal Reports 2016 ; SAP Crystal Reports 2020 ; SAP Crystal Reports, developer version for Microsoft Visual Studio ; SAP Crystal Reports, version for Eclipse all versions

Attachments

Test.rpt
Test.xls