
1. Re: How do I rounding up a calculation
alecgregory Nov 14, 2016 2:47 PM (in response to sueanne)Ceiling ( Total rounds / 4 ) should do it

2. Re: How do I rounding up a calculation
philmodjunk Nov 14, 2016 3:15 PM (in response to alecgregory)unless you want a value such as 16.25 to round to 16. In otherwords, if you want values of 16.5 to round to the next larger integer, 17 and values less than 16.5 to round to the next smaller integer (16), then you can just use the round function:
Round ( 16.75 ; 0 ) > 17
Round ( 16.49 ; 0 ) > 16

3. Re: How do I rounding up a calculation
sueanne Nov 15, 2016 5:38 AM (in response to philmodjunk)If I was working with just a number field, but the 16.75 is a result of a calculation.
(total rounds of widgets / 4) returns 16.75 or 19.2...
Do I need a second field to round up or down the numeric result? Or can I somehow extend the calculation to do that?

4. Re: How do I rounding up a calculation
David Moyer Nov 15, 2016 5:43 AM (in response to sueanne)Hi,
you do not need a second field  you can just nest the functions. Post #1 is how I would have answered your question. Post #2 suggests then standard mathematical rounding function. Combining the two would be:
Round ( TotalRounds / 4; 0 )

5. Re: How do I rounding up a calculation
sueanne Nov 15, 2016 6:41 AM (in response to David Moyer)Excellent  thank you

6. Re: How do I rounding up a calculation
BruceHerbach Nov 15, 2016 8:17 AM (in response to sueanne)If you want 16.x to always go to 17 use the ceiling function.
ceiling(16.01) = 17
HTH

7. Re: How do I rounding up a calculation
taylorsharpe Nov 15, 2016 9:37 AM (in response to sueanne)Be aware of the different situations where you want the calculation to round verses wanting a field in a layout to display rounded numbers. It could be that you want to retain the full decimal accuracy, but only display it rounded. In the inspector under the data tab at the bottom you can format number fields to be decimal so that you can set it to round to 0 for whole numbers. That way you display it rounded, but you don't change the underlying result. Just note that the layout formatting will effect how things display regardless of the value as calculated or typed, but does not change the actual number.

8. Re: How do I rounding up a calculation
philmodjunk Nov 15, 2016 9:44 AM (in response to sueanne)The basic rule for whether you round the value or round the display is "will this value be used in subsequent calculations"? Most of the time (not always), you want to keep all values unrounded until you compute the final result so you would round the display of any intermediary values if you need to show them, but use the unrounded value for additional calculations.
The common exception to the above is when the intermediary value represents currency that has to be used in a financial transaction. Then you sometimes have no choice but to round intermediary valuessay it's a calculated loan payment where the customer can't make payments in fractions of a penny..., and have to take other steps to adjust for the accumulated round off errorsuch as adjusting the final loan payment up or down by a small amount so that the total payments exactly equals the total loan.

9. Re: How do I rounding up a calculation
sueanne Nov 15, 2016 9:57 AM (in response to philmodjunk)All good advice. Found out it works in a variety of software.
My application was simple figuring out portions for a Chef with out having to calculate 7/8 of a turkey.
Thank you all.