MCPcopy Create free account
hub / github.com/ActiveState/code / plural

Function plural

recipes/Python/546532_PyChecker_postprocessor/recipe-546532.py:231–235  ·  view source on GitHub ↗

Format a plural string.

(n, unit)

Source from the content-addressed store, hash-verified

229
230
231def plural(n, unit):
232 '''Format a plural string.
233 '''
234 s = 's' if n != 1 else ''
235 return '%s %s%s' % (n or 'no', unit, s)
236
237
238def quoted(text):

Callers 6

convertToHumanReadableFunction · 0.85
allistMethod · 0.85
getMethod · 0.85
runMethod · 0.85
warningsMethod · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected