JanetDocsI'm feeling luckyGithub sign in

scan-number



    cfunction

    (scan-number str)
    
    Parse a number from a byte sequence an return that number, either and
    integer or a real. The number must be in the same format as numbers in
    janet source code. Will return nil on an invalid number.


1 exampleSign in to add an example
Loading...
(scan-number "123") # => 123
(scan-number "f") # => nil

(scan-number 123) # =>
# error: bad slot #0, expected string|symbol|keyword|buffer, got 123
#   in scan-number
#   in _thunk [repl] (tailcall) on line 1, column 1
swlkr