XLISP digit-char

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference

# digit-char

Type: | - | function (subr)
Source: | - | xlstr.c

## Syntax

(digit-char int)
  int - an integer expression
  returns - the digit character or NIL

## Description

The 'digit-char' function takes an integer expression 'int' and converts it into a decimal digit character. So, an integer value of '0' produces the character '#\0'. An integer value of '1' produces the character '#\1' and so on. If a valid character can be produce it is returned, otherwise a NIL is returned.

## Examples

    (digit-char 0)    ; returns #\0
    (digit-char 9)    ; returns #\9
    (digit-char 10)   ; returns NIL

Common Lisp: Common Lisp supports the use of an optional radix parameter. This option specifies numeric base. This allows the 'digit-char' to function properly for hexadecimal digits [for example]. Common Lisp supports up to base 36 radix systems. XLISP does not support this radix parameter. Common Lisp also supports a font parameter which XLISP does not.

See the digit-char function in the XLISP 2.0 manual.

Back to Top

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference