Class FormatListItem
New in version 0.6.6.
- class ooodev.formatters.format_list_item.FormatListItem(format, idxs)[source]
- Parameters:
format (str | Tuple[str, ...]) –
idxs (Sequence[int]) –
- __init__(format, idxs)[source]
- Parameters:
format (str | Tuple[str, ...]) –
idxs (Sequence[int]) –
- Return type:
None
- has_index(idx)[source]
Gets if instance contains
idx
- Parameters:
idx (int) – Index value
- Returns:
True
if index is found; Otherwise,False
- Return type:
bool
- property format: str | Tuple[str, ...]
Gets Format
Format option such as
.2f
Multiple formats can be added such as
(".2f", "<10")
. Formats are applied in the order they are added. In this case first float is formatted as string with two decimal places, and then value is padded to the right with spaces.- Return type:
str | Tuple[str, …]
- property idxs: Sequence[int]
Gets indexes of a list that this formatting applies to
- Return type:
Sequence
[int
]