mirror of
https://github.com/platomav/BIOSUtilities.git
synced 2025-05-12 22:26:13 -04:00

Added AMI PFAT nested detection at each file Added Award BIOS payload naming at each file Switched Panasonic BIOS LZNT1 external library Improved Panasonic LZNT1 detection and length Improved Dell PFS code structure and fixed bugs Improved code exception handling (raise, catch) Improved code definitions (PEP8, docs, types) Fixed some arguments missing from help screens
19 lines
429 B
Python
19 lines
429 B
Python
#!/usr/bin/env python3 -B
|
|
# coding=utf-8
|
|
|
|
"""
|
|
Copyright (C) 2022-2024 Plato Mavropoulos
|
|
"""
|
|
|
|
|
|
def get_ordinal(number):
|
|
"""
|
|
Get ordinal (textual) representation of input numerical value
|
|
https://leancrew.com/all-this/2020/06/ordinals-in-python/ by Dr. Drang
|
|
"""
|
|
|
|
txt = ('th', 'st', 'nd', 'rd') + ('th',) * 10
|
|
|
|
val = number % 100
|
|
|
|
return f'{number}{txt[val % 10]}' if val > 13 else f'{number}{txt[val]}'
|