Hello,
a small code to facilitate the agreement in the plural of a text.
The idea is to send as a parameter a text (column or fixed) and a number in order to determine whether to put the text in the plural.
EDIT Revision 3
Deletion of the Criterion parameter
Automatic detection of number column type for number, boolean, text use
I translated this code to English and had a bit of a different approach here.
Input: Number & Singular/Plural format of the text (e.g: teacher/teachers, shelf/shelves, watch/watches). This covers all the cases when it’s not simply just “s”.
Output: Number and the right unit text. (1 is singular, 0 and > 1 are plural)
If I recall right, @Darren_Murphy and @Robert_Petitto had been calling for this unit thing to be available for the math column/number column for so long.
If I can afford it.
I made a criterion, to be able to also use boolean values ​​like Count values
After, using the “/” as a marker can be “dangerous” like a “page 1/10” text suddenly it doesn’t work anymore.
But your script is fine too