FormatFloat#

class FormatFloat(*args, **kwargs)#

Bases: FormatNumberAbstract

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

generate_expression(capture=False)#

Generate a regular expression matching strings created with this format.

Return type:

str

get_left_of_decimal()#

Get regex for the numbers left of decimal point.

Will deal with grouping if present. Some simplifications for eE formats. Only use groupings for ‘0=’ alignment and enforce single digits grouping.

Return type:

str

get_right_of_decimal()#

Return regex for numbers after decimal points.

Including the decimal point itself. It will respect ‘alternate’ option and the specified precision.

Return type:

str

parse(s)#

Parse string generated with format.

Parameters:

s (str)

Return type:

float