Skip to Content
avatar image
Former Member

How to convert .10 number to whole number in crystal report

Hello Experts!

I would like to insert a field in crystal report that will be converted to a whole number. It comes from a UDF from the OCRD (Business Partner Master Data). The values are decimal , most values that will be entered to that UDF is .10, .20 and .30.

When inserting this field to the crystal report, I want it to appear as a whole number. I plan to create a formula field but I'm not sure what formula to use cause I'm new to SQL etc. :) Or can you suggest another option where I can convert the decimal value from SAP to a whole number in Crystal report?

Thanks!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 28, 2016 at 01:33 PM

    Hi Nikka,

    You can format your number inside crystal, without formula.

    First right click on your field in crystal and choose the option "format field", after this, a new screen will be opened. After this follow the steps on the images.

    Hope it helps.

    Kind Regards,

    Diego Lother

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Nikka,

      I hadn't understood all the context. But I if understand now, your udf field is a varchar field and have a "." in the begin. If yes, the way is the following, you can do this in your sql:

      CAST(REPLACE(yourField, ',' '') AS INT)

      But if your field is type float like 0.10, 0.20.

      You can follow the suggestion below in Smith's answer and in your sql do this:

      CAST((yourField * 100) AS INT)

      or

      yourField * 100

      and follow my first answer how to configure numeric field in crystal report.

      Hope it helps.

      Kind Regards,

      Diego Lother

  • Oct 29, 2016 at 03:27 AM

    why not *100

    Add comment
    10|10000 characters needed characters exceeded