Eno::Loaders ยป #float

float โ†’ Float
float_items โ†’ array
float_list โ†’ array

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
rubydocument = Eno.parse(input)

document.float('good')  #=> 49.9
document.float('fine')  #=> -2.0

document.float('bad')
  # raises an error: 'bad' must contain a decimal number, for instance '13.0', '-9.159' or '42'.