PDA

Click to See Complete Forum and Search --> : Formating numbers in Crystal reports


Rocketdawg
Sep 24th, 2008, 03:59 PM
Hi

I've got a view created for a subreport.

There are a few columns that display decimal values ( Like 100.00, 17.00, 1.25)

If the value after the decimal place is 00, they don't want it to be displayed.
So 100.00 would be 100 and 1.25 would be the same: 1.25

How could that be done?

Thanks!

brucevde
Sep 25th, 2008, 11:31 AM
Create the following Formula and display it instead of the Database field.

if {TableName.DecimalFieldName} mod Int ({TableName.DecimalFieldName}) = 0 then
totext({TableName.DecimalFieldName},0)
else
totext({TableName.DecimalFieldName},2)

Rocketdawg
Sep 26th, 2008, 12:13 PM
Thank you! It was one of those last minute "wish it would..." things.

Cheers