Class FormatString

New in version 0.6.6.

class ooodev.formatters.format_string.FormatString(row_kind=StringKind.NONE)[source]

Bases: FormatListItem

Parameters:

row_kind (StringKind) –

__init__(row_kind=StringKind.NONE)
Parameters:

row_kind (StringKind) –

Return type:

None

get_formatted(val)[source]
Return type:

str

Parameters:

val (str) –

has_index(idx)

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]

row_kind: StringKind = 0