Tuesday, August 25, 2009

Crystal Reports : Changing the decimal precision on a field

In the case of "calculated" fields, especially where division is involved, the result can sometimes be a number like "10.25" or "13.53".
Crystal will default the formatting of such a result to include the decimal places as the calculation requires.
If you only wish to see the "integer" portion of the field in question, you need only to change the field formatting.

1. Right-click on the field in question
2. Select "Format Field"
3. On the "Common" tab, click "Customize"
4. Drop down the "Decimals" list to select your desired precision.
5. "Ok" your way back out.

Note : These Field Formatting options are only available on numeric fields. If your formula is returning a string, try using the ToNumber() Crystal function to convert it.

No comments: