app/utilities/utilities.py
def center_value(obj, stat_or_name):
    """Add spaces in order to center a text within an entry."""

    obj_length = len(str(obj))
    amount_of_maxium_spaces = 21 if stat_or_name != 'stat' else 4
    amount_of_avaliable_spaces = amount_of_maxium_spaces - obj_length
    centered_obj = f"{amount_of_avaliable_spaces * ' '}{obj}"

    return centered_obj
Add spaces in order to center a text within an entry.
Add spaces in order to center a text within an entry.
Add spaces in order to center a text within an entry .
def center_value(obj, stat_or_name):
    obj_length = len(str(obj))
    amount_of_maxium_spaces = 21 if stat_or_name != 'stat' else 4
    amount_of_avaliable_spaces = amount_of_maxium_spaces - obj_length
    centered_obj = f"{amount_of_avaliable_spaces * ' '}{obj}"
    return centered_obj
def center_value ( obj , stat_or_name ) : obj_length = len ( str ( obj ) ) amount_of_maxium_spaces = 21 if stat_or_name != 'stat' else 4 amount_of_avaliable_spaces = amount_of_maxium_spaces - obj_length centered_obj = f"{amount_of_avaliable_spaces * ' '}{obj}" return centered_obj
Add spaces in order to center a text within an entry.
Add spaces in order to center a text within an entry .
"""Add spaces in order to center a text within an entry."""
obj
stat_or_name