Function recognize_float

fn recognize_float<T, E: ParseError<T>>() -> impl Parser<T, Output = T, Error = E>
where
    T: Clone + Offset + Input,
    <T as Input>::Item: AsChar

Recognizes a floating point number in text format and returns the corresponding part of the input.

Streaming version: Will return Err(nom::Err::Incomplete(_)) if it reaches the end of input.

# use nom::{Err, error::ErrorKind, Needed, Parser};
use nom::number::recognize_float;

let parser = |s| {
  recognize_float().parse(s)
};

assert_eq!(parser("11e-1;"), Ok((";", "11e-1")));
assert_eq!(parser("123E-02;"), Ok((";", "123E-02")));
assert_eq!(parser("123K-01"), Ok(("K-01", "123")));
assert_eq!(parser("abc"), Err(Err::Error(("abc", ErrorKind::Char))));