Report field rounding down

  • Thread starter Thread starter Kat3n
  • Start date Start date
K

Kat3n

I created a field on a report and it is rounding down instead of up. It is
simply dividing a whole number by another whole number. Why is it doing this?
Thanks in advance for your help
 
I created a field on a report and it is rounding down instead of up. It is
simply dividing a whole number by another whole number. Why is it doing this?
Thanks in advance for your help

How would any of us know?
Please tell exactly us what the control's Control source is.
Please tell us what you expect to get.
Please tell us exactly what you do get.

An example is worth a thousand words.
 
Control Source is "=([lossum]\[totallos])
lossum is 726 and totallos is 94, the answer should be 7.72 but I prefer it
return 8, however it is returning 7.
 
You are using integer division when you use the \ to do division. Integer
division returns the truncated integer value.

If you want to round the value you can try
= Round([lossum]/[totallos],0)

That will round to no decimal portion, however it does use bankers rounding.
That means if the decimal portion is exactly .5 it will round down for odd
numbers and up for even numbers.

If you want to always round up (7.1 becomes 8) then use this expression
=-Int(-[lossum]/[totallos])

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top