Skip to Content

How to remove decimals and round it off as a whole

Hi Team

Basically, I have 2 formula fields in my details section.

I want them to be displayed as a whole number without decimal places.

How can I get rid of the decimal place? Do I have to edit it in a formula and out round () formula?

My formula on the @Details is:

WhilePrintingRecords; NumberVar ItemCount := ItemCount + 1;

My formula on @LineCount is:

WhilePrintingRecords; NumberVar ItemNumber; CStr(ItemNumber, "0") & "/" & CStr(Count({rpt_PackingSlip.LabelQTY}, {rpt_PackingSlip.WorkOrderNo}))

Please assist.

capture.jpg (79.6 kB)
capture1.jpg (24.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 13, 2018 at 08:14 AM

    Never used cstr I always use totext() and that will achieve what you want

    ToText(ItemNumber, 0) & "/" & ToText(Count({rpt_PackingSlip.LabelQTY}, {rpt_PackingSlip.WorkOrderNo}),0)

    If you numbers are likely to exceed 1000 and you do not want , thousand separator

    ToText(ItemNumber, 0,"") & "/" & ToText(Count({rpt_PackingSlip.LabelQTY}, {rpt_PackingSlip.WorkOrderNo}),0,"")


    Add comment
    10|10000 characters needed characters exceeded

    • In your example you have Sales order which is same for both Abbey & charlotte. Is salesorder same as


      If you want to count on Description you will have to add another group based on Description field, add this below WorkOrderNo Field, suppress header and footer. Change your formula to

      ToText(Count({rpt_PackingSlip.LineNo}, {yourdescriptiongroupfield}),0)