Skip to main content

pluralize

Pluralize term when n is greater than one.

def pluralize(
n: float,
text: string,
suffix: string = s
) - > string

Pluralize term when n is greater than one.

Parameters

NameTypeDescription
nfloatThe numeric value used to determine if the text should be pluralized.
textstringThe singular form of the word or term to be modified.
suffixstring = sThe string to append to the text when n indicates a plural state.

Returns

TypeDescription
stringThe original text with the suffix appended if n is not equal to 1, otherwise the original text.