Brian Dunning's FileMaker Custom Functions

Pluralize ( text, quantity )

English only. Pluralize a word.

  Be the first to rate this function Log in to vote

Jason P. Scharf   Jason P. Scharf - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
Let(
[
cactus_count = 2;
matrix_count = 25;
world_count = 0;
vortex_count = 1
];

List(
"I have " & cactus_count & " " & Pluralize( "cactus"; cactus_count ) & ".";
"There are " & matrix_count & " " & Pluralize( "matrix"; matrix_count ) & ".";

// If multiple words are provided, will only return the plural form of the last word
"There are " & world_count & " outer " & Pluralize( "Hello World"; world_count ) & ".";

// If the quantity is 1/-1 return the last word, as is.
"Only " & vortex_count & " " & Pluralize( "Only one vortex"; vortex_count ) & ".";
"So little " & Pluralize ( "free time"; -1 ) & ".";
)
)
  Sample output:
I have 2 cacti.
There are 25 matrices.
There are 0 outer Worlds.
Only 1 vortex.
So little time.

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

Based off of Kieran Harvey MakePlural(Text), but it handles 82 of the most common irregular plurals.

Requires FileMaker Pro 16+.

NOTE: If an irregular now is made plural, its original case will be ignored, and the result will be all lowercase.

The following irregular noun plurals are supported:

aircraft, alumna, alumnus, analysis, antithesis, appendix, axis, bacillus, bacterium, basis, beau, bison, cactus, child, codex, corpus, crisis, datum, deer, diagnosis, ellipsis, erratum, faux pas, fez, focus, foot, fungus, genus, goose, graffito, grouse, hoof, hypothesis, index, larva, libretto, locus, louse, man, matrix, memorandum, minutia, moose, mouse, nebula, nucleus, oasis, offspring, ovum, ox, parenthesis, person, phenomenon, phylum, prognosis, quantum, quiz, radius, salmon, series, serum, sheep, shrimp, species, stimulus, stratum, swine, syllabus, synopsis, testis, that, thesis, thief, this, tooth, trout, tuna, vertebra, vertex, vita, vortex, woman

 

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 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: