Skip to content

Commit 68be3ca

Browse files
committed
docs(polynum): add usage guidance for PolyNum.format method
Adds documentation to clarify when to use the `format` method versus the simpler `plural` method. The added comment explains that `format` provides flexible number formatting with additional options, but `plural` is recommended for simple pluralization cases.
1 parent 85fb673 commit 68be3ca

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/polykit/text/polynum.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ def format(
8383
) -> str:
8484
"""Format a number with various options for text representation.
8585
86+
This method provides a flexible way to format numbers with optional word and ordinal
87+
representations, as well as the ability to include or exclude the number itself. It's
88+
recommended NOT to use this method solely for pluralization. It's simpler to just use
89+
`PolyNum.plural` directly, unless you need additional formatting options.
90+
8691
Args:
8792
number: The number to format.
8893
word: Optional word to append (will be pluralized if needed).

0 commit comments

Comments
 (0)