loaders ยป float
float() โ float
floatItems() โ array
floatList() โ array
Accepts floats (decimal part can be missing though), returns a float (or throws an error for malformed values).
enogood: 49.9
fine: -2
bad: three
javascriptconst document = eno.parse(input);
document.float('good'); // returns 49.9
document.float('fine'); // returns -2.0
document.float('bad');
// throws an error: 'bad' must contain a decimal number, for instance '13.0', '-9.159' or '42'.