digit-value - get the numeric value of a character
(import (scheme char)) ;R7RS
This procedure returns the numeric value of its argument if it is a numeric
digit or #f on any other character. Numeric digits are those for which
char-numeric? returns #t. Only the numeric values 0 to 9 are
supported; characters representing other values are non-numeric.
Returns a single value; an exact integer or #f.
(digit-value #\3) => 3
(digit-value #\x0664) => 4 ;if supported
(digit-value #\x0AE6) => 0 ;if supported
(digit-value #\x0EA6) => #f ;if supported
Implementations are not required to support characters other than ASCII
(excluding #\null). Therefore only the characters #\0 to
#\9 need to be supported. Even implementations with full Unicode
support may return #f for some characters that other implementations
support, because the Unicode standard changes over time.
It is an error if the wrong number of arguments was passed or an argument was
outside its domain. Implementations may signal an error, extend the
procedure's domain of definition to include such arguments, or fail
catastrophically.
This procedure first appeared in R7RS.