Rounding Up:
The Round() function in FileMaker Pro rounds numbers to the nearest significant digit, which may be either up or down. The Round() function can be programmed to always give you either a rounded-up or a rounded-down result.
To always round up to the next nearest integer, the calculation formula would be:
Round (Number + .499999, 0)
The addition of .499999 is just slightly less than one-half. If one-half is added to an integer and rounded, the result would incorrectly return the next higher integer.
To round up to the nearest penny (.01), your calculation formula would be:
Round (Number + .00499999, 2)
To round up to the nearest nickel, $.05:
INT (SellingPrice * 20 + .5) / 20 - where SellingPrice is a number or calculation field.
To round up to the nearest fifty cents, $.50
INT (SellingPrice*2 + 0.5) / 2 - where SellingPrice is a number or calculation field.
To round up to the nearest $5.00:
INT ((Dollar Amount+4.99)/5) * 5
To round to the nearest even integer:
INT((Number + 1)/2) * 2
Numbers with even integers will stay the same, losing their decimal values. Odd integers will become a rounded even integer. Example: 22.3 becomes 22 whereas 23 becomes 24.
Rounding Down:
To return the next lower integer, one-half can be subtracted, because subtracting one-half from an integer and then rounding, results in the integer. Therefore, the calculation formula would be:
Round (Number - .5, 0)
Since the above formula rounds down to an integer, a more efficient way would be to use the IntÊ() function. The calculation formula can be modified to:
Int (Number)
To round down to the nearest penny, your calculation formula would be either:
Round (Number - .005, 2)
or
Int (Number * 100) / 100
To round to the nearest 5 as it is with weights in a fitness center (5, 10, 15, 20) you can take the number and use the Round () and Int () functions:
Round ((Int (((Number) + 2.50) / 5) * 5), 0)
This will take any number and round it up or down to the nearest 5 and keep it a whole number rounded with no decimal points. (e.g.; 28 will round up to 30, 42 will round down to 40, 4 will round up to 5)
--------------------
If you are using a ClarisWorks database, the formulas above would be written as follows:
To round up to the next nearest integer:
ROUND('Number'+0.499999,0)
To round up to the nearest penny:
ROUND('Number'+0.00499999,2)
To round up to the nearest nickel, $.05:
INT('SellingPrice'*20+0.5)/20
To round up to the nearest fifty cents, $.50:
INT('SellingPrice'*2+0.5)/2
To round up to the nearest $5.00:
INT(('Dollar Amount'+4.99)/5)*5
To round to the nearest even integer:
INT(('Number'+1)/2)*2
Rounding Down
To return the next lower integer:
ROUND('Number'-0.5,0)
Or, alternately:
INT('Number')
To round down to the nearest penny:
ROUND('Number'-0.005,2)
or
INT('Number'*100)/100