Brian Dunning's FileMaker Custom Functions

FlexCeiling ( number ; precision )

An expanded "Ceiling" that accepts a precision argument

  Average rating: 4.1 (37 votes) Log in to vote

Kevin Frank   Kevin Frank
Kevin Frank & Associates

Share on Facebook Share on Twitter

  Sample input:
FlexCeiling( 123.341 ; -3)
FlexCeiling( 123.341 ; -2)
FlexCeiling( 123.341 ; -1)
FlexCeiling( 123.341 ; 0)
FlexCeiling( 123.341 ; 1)
FlexCeiling( 123.341 ; 2)
FlexCeiling( 123.341 ; 3)
  Sample output:

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

While the Ceiling function by definition returns the smallest integer >= x, I found myself wishing it could accept a precision argument the way Round does. The FlexCeiling custom function allows this to happen.

Essentially, FlexCeiling is a "magic Round" that always makes a number larger -- regardless of whether that number is positive or negative -- whereas Rounding (via the Round function) a negative number "up" actually makes it smaller (more negative).

E.g., Round ( -4.7 ; 0 ) = -5 whereas FlexCeiling ( -4.7 ; 0 ) = -4

Note: see also the companion custom function, FlexFloor.



Log in to post comments.


Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth:

Under construction. Email me your wish list for improvements.