Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to specify decimals format fields in CR6

Status
Not open for further replies.

superdorm

Programmer
Aug 2, 2000
3
0
0
FR
I would like to specify decimals format fields by condition eg.
if name = x then
2 decimals
else if name = y then
3 decimals
else
0 decimal

i can use if-then-else in crystal report but when i use 1.00 instead of 2 decimals format, the result is 1.00 (it should be 20.25)
 
you can conditionally specify the no. of DPs for a field by right clicking the field on the report, and select Format Field. Click on the formula button to the right of the Decimals selection dropdown. This brings up the formula editor. Something along the lines of :

if {field name}=x then 2 else 3

this then formats this field to be a 2dp if the value is x in that field, otherwise 3dp. Try adapting this type of formula to your situation

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top