parse-number
parse-number accepts an arbitrary string and attempts to parse the string into one of the standard Common Lisp number types, if possible, or else parse-number signals an error of type invalid-number.

Exported symbols

Function PARSE-NUMBER (string &key start end radix float-format)
Function PARSE-REAL-NUMBER (string &key start end radix float-format)
Function PARSE-POSITIVE-REAL-NUMBER (string &key start end radix float-format)
Condition INVALID-NUMBER
Reader INVALID-NUMBER-VALUE
Reader INVALID-NUMBER-REASON

Download

The source code is availabe from a repository at github. You can download the repository as a zip file or you can get a tar file of the version 1.3.
In addition parse-number is available via Quicklisp.

Installation

parse-number comes with an asdf file for compilation.

You can test the installation with asdf. This is an example output:

 (asdf:test-system :parse-number)
=> .PARSE-NUMBER: 23 assertions passed, 0 failed.
=> T

Documentation

An online documentation is availabe at parse-number API documentation.

Note

parse-number does not handle thousands separators, so if you use this package, you might think about adding that.