Hi, Using Filemaker Pro 14 - I am working with an established set of records, trying to add in an estimating page. I'm stuck now getting our measurements (window glass) to round up to the next even integer to calculate the cost by total square feet..

For instance the measurements of a window would be 47.5" x 39.75" . Our cost and customer pricing is charged by the even inches so we would base our charge on 48" x 40". In Excel, I found a function to do this calculation, and found a custom function for Filemaker Pro Advanced, but so far am unable to determine a calculation or script that isn't quite cumbersome and prone to errors to do this.

Can anyone help me with this?

Barbara

Here is a simple mathematical solution to round up to the next even number:

ceiling( $Number / 2 ) * 2

gives:

0 -> 0

0.1 -> 2

1.0 -> 2

1.5 -> 2

2 -> 2

3 -> 4

4 -> 4

5 -> 6

6 -> 6

7 -> 8

8 -> 8

9 -> 10

10 -> 10

You can generalise the function to round up to the next $roundUpToNumber like this:

ceiling( $Number / $roundUpToNumber ) * $roundUpToNumber

Thus to round up a number to the next 5

ceiling( $Number / 5 ) * 5

gives:

0 -> 0

1 -> 5

2 -> 5

3 -> 5

4 -> 5

5 -> 5

6 -> 10

7 -> 10

8 -> 10

9 -> 10

10 -> 10