# num() function

The num() function evaluates an expression
and returns 1 (true) if it is a decimal numeric. Otherwise, it returns
0, if the expression contains any nonnumeric characters.

## Syntax

```
num(exp)
```

## Parameter(s)

| exp | Expression to test. If it is a decimal numeric, 1 (true) is returned. If it contains any nonnumeric characters, 0 is returned. |
| --- | --- |

## Description

The empty, or null string (`""`) is considered to be a numeric string.

The strings
below are considered to be numeric, and return a 1:

- . (period)

- - (minus)

- + (plus)

- -. (minus/period)

- +. (plus/period)

## Example(s)

This loop terminates when a numeric
response is entered for the variable `number`.

```
loop
input number
until num(number) do repeat
```

## See also

- [alpha() function](https://d3codex.com/pickbasic-flashbasic/alpha-function/)
- [Boolean evaluation](https://d3codex.com/pickbasic-flashbasic/boolean-evaluation/)
- [BASIC functions](https://d3codex.com/pickbasic-flashbasic/basic-functions/)
- [match relational operator](https://d3codex.com/pickbasic-flashbasic/match-relational-operator/)
- [Statements and functions](https://d3codex.com/pickbasic-flashbasic/statements-and-functions/)

---
Source: https://d3codex.com/pickbasic-flashbasic/num-function/ - part of the D3Codex reference.
