Pluralize ( text, quantity )
English only. Pluralize a word.
Average rating: 5.0 (1 vote) Log in to vote
Jason P. Scharf - Show more from this author |
[
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 ) & ".";
)
)
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
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.