Results 1 to 3 of 3

Thread: Formating numbers in Crystal reports

  1. #1

    Thread Starter
    Hyperactive Member Rocketdawg's Avatar
    Join Date
    Feb 2003
    Location
    Back in the doghouse
    Posts
    294

    Formating numbers in Crystal reports

    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!

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Formating numbers in Crystal reports

    Create the following Formula and display it instead of the Database field.

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

  3. #3

    Thread Starter
    Hyperactive Member Rocketdawg's Avatar
    Join Date
    Feb 2003
    Location
    Back in the doghouse
    Posts
    294

    Re: Formating numbers in Crystal reports

    Thank you! It was one of those last minute "wish it would..." things.

    Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width