Brian Dunning's FileMaker Custom Functions

suffixNumber

Given any number, this function calculates the suffix. For example 1 calculates

  Average rating: 4.6 (31 votes) Log in to vote

Michael Richards   Michael Richards - Show more from this author
itraining
http://www.itraining.com.au

Share on Facebook Share on Twitter

  Sample input:
suffixNumber ( 1 )
suffixNumber ( 2 )
suffixNumber ( 3 )
suffixNumber ( 4 )
suffixNumber ( 21 )
suffixNumber ( 22 )
  Sample output:
st
nd
rd
th
st
nd

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

Filemaker provides the ability to customise the formatting and display of a date, time and number. However there is no functionality to calculate a conditional suffix (units); a human readable suffix.

For a given number this custom funtion calculates the human readable suffix; "st", "nd" , "rd" , "th".

It is predominantly used for date related calculations where the day number is displayed with human readable units. For example:
(a) payment is the 1st of every month
(b) fees are due on the 2nd week of every month
(c) 3rd quarter results were up
(d) the 24th is great for us to meet

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. 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 20 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: