FormatNumberAbstract#

class FormatNumberAbstract(*args, **kwargs)#

Bases: FormatAbstract

Represent a format string for numbers (type d, f, e, E).

get_left_of_decimal()#

Get regex for the numbers left of decimal point.

Will deal with grouping if present.

Return type:

str

get_sign_regex(capture=False)#

Get sign regex with approprite zero padding.

Return type:

str

prepare_parse(s)#

Remove special characters.

Remove characters that throw off int() and float() parsing: fill/alignment characters and grouping symbols.

Returns:

s – a string ready to be casted to the appropriate type.

Parameters:

s (str)

Return type:

str