Skip to Content
avatar image
Former Member

Format specific values in the column.

I'm trying to format specific values in the same column of crystal report.

The column should show all the other numbers as decimals, except for 100. 100 should be shown as a whole number.
I'm showing {@Numeric2} in the detail of the column.

This is what I did.
In format field, Number tab, customize, For Decimal I entered following formula;
If {@Numeric2} = 100 Then 1 Else 1.0

The problem is that it is not rounding 100 as a whole, instead, showing 100 as a decimal as well like 100.0

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 09 at 10:31 PM

    Two options:

    1. Right-click the field > Format Field > Number tab > Customize... > Use Rounding and Decimal formulas here

    2. another option is to convert the number to string like:

    If { @Numeric2 } = 100 then "100" else Totext ( {@Numeric2 } , 2)

    Add comment
    10|10000 characters needed characters exceeded