SAP Knowledge Base Article - Public

1216679 - How to conditionally display a currency symbol

Symptom

In Crystal Reports, how do you conditionally display a currency symbol?

For example, if the value of a currency field is greater than zero, you want the currency symbol to appear. If the value is zero or less, you do not want it to appear.

Environment

SAP Crystal Reports 2016

Resolution

Create a conditional format formula that uses currency symbol constants.

1. Right-click the currency field and then click 'Format Field'.

2. Click the 'Number' tab and then click the 'Customize' button.

3. In the 'Custom Style' dialog box, click the 'Currency Symbol' tab and then click the 'X+2' button to the right of the 'Enable Currency Symbol' check box.

4. Enter the following formula:

If {Table.Field} > 0 then crFloatingCurrencySymbol else crNoCurrencySymbol

5. Click the 'Save and Close' button, click 'OK' and then click 'OK' again.

When the report is refreshed, any records with positive values will have the currency symbol appear to the left of the value.

====================

NOTES:

" If you want the currency symbol to appear at the far left side of the field, instead of adjacent to first digit in the value, use the 'crFixedCurrencySymbol' constant instead of the 'crFloatingCurrencySymbol' constant in your formula.

" When conditionally formatting a currency field, the 'Functions' window of the 'Format Formula Editor' includes the 'Currency Symbol Constants'. These do not appear when conditionally formatting non-currency fields or in the Formula Editor.

====================

Keywords

CURRENCY SYMBOL DOLLAR SIGN POUND YEN DEUTSCHMARK FRANC APPEAR DISPLAY Crystal Reports Conditional formatting Currency fields , c2014583 , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To

Product

SAP Crystal Reports 8.0