Reads the next token as a decimal number. The second result is false when the token is not entirely a
number, or there is none.
parse_float :: (
line: *string,
delimiters := DEFAULT_DELIMITERS,
spaces := DEFAULT_SPACES
) -> (value: float, success: bool)
Parameters
- line: *string
- delimiters := DEFAULT_DELIMITERS
- spaces := DEFAULT_SPACES
Returns
- value: float
- success: bool
line := "2.5 rest";
value, ok := parse_float(*line);
assert(ok && value == 2.5);