Skip to Content

Format specific values in the column.

Feb 09 at 09:32 PM


avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Vitaly Izmaylov
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)

10 |10000 characters needed characters left characters exceeded