Discussions

Expand all | Collapse all

How to change a decimal to whole number

  • 1.  How to change a decimal to whole number

    Posted 11-20-2018 15:03
    I have a number field labeled QTY. I have another field labeled Final totals that looks at the QTY field and divides by 2. But if its a decimal i need it to round up to a whole number.

    For example: if QTY=7 the Finals Totals: 3.5. It should be 4 for the Final Totals.

    Is this possible with a formula?


  • 2.  RE: How to change a decimal to whole number

    Posted 11-20-2018 15:13
    Just use the Round() function on the result


  • 3.  RE: How to change a decimal to whole number

    Posted 11-20-2018 15:29
    Thanks, that work perfectly.


  • 4.  RE: How to change a decimal to whole number

    Top
    Contributor
    Posted 11-21-2018 10:35
    Actually if you want to consistently round up you should use Ceil([Qty]/2) as Round([Qty]/2) rounds to the nearest integer. Round([Qty]/2) appears to work only because your [Qty] in an integer.