loaders ยป float
float() โ float
float_items() โ list
float_list() โ list
Accepts floats (decimal part can be missing though), returns a float (or raises an error for malformed values).
enogood: 49.9
fine: -2
bad: three
python>>> document = Eno.parse(input)
>>> document.float('good')
49.9
>>> document.float('fine')
-2.0
>>> document.float('bad')
ValidationError: 'bad' must contain a decimal number, for instance '13.0', '-9.159' or '42'.