MCPcopy Create free account
hub / github.com/python-pendulum/pendulum / ordinalize

Method ordinalize

src/pendulum/locales/locale.py:83–89  ·  view source on GitHub ↗
(self, number: int)

Source from the content-addressed store, hash-verified

81 return cast(str, self._data["ordinal"](number))
82
83 def ordinalize(self, number: int) -> str:
84 ordinal = self.get(f"custom.ordinal.{self.ordinal(number)}")
85
86 if not ordinal:
87 return f"{number}"
88
89 return f"{number}{ordinal}"
90
91 def match_translation(self, key: str, value: Any) -> dict[str, str] | None:
92 translations = self.translation(key)

Callers 1

Calls 2

getMethod · 0.95
ordinalMethod · 0.95

Tested by

no test coverage detected