feat: add suffix ordinals (#845)

* add suffix ordinals with lambda

* delay importing of modules.config (#2195)

* refactor: use easier to read version to find matching ordinal suffix

---------

Co-authored-by: rsl8 <138326583+rsl8@users.noreply.github.com>
Co-authored-by: Manuel Schmid <manuel.schmid@odt.net>
Co-authored-by: Manuel Schmid <9307310+mashb1t@users.noreply.github.com>
This commit is contained in:
hisk2323
2024-02-10 21:49:23 +01:00
committed by Manuel Schmid
co-authored by rsl8 Manuel Schmid Manuel Schmid
parent b9d7e77b0d
commit eb3f4d745c
2 changed files with 6 additions and 3 deletions
+4
View File
@@ -175,3 +175,7 @@ def get_files_from_folder(folder_path, exensions=None, name_filter=None):
filenames.append(path)
return filenames
def ordinal_suffix(number: int) -> str:
return 'th' if 10 <= number % 100 <= 20 else {1: 'st', 2: 'nd', 3: 'rd'}.get(number % 10, 'th')