---
title: strings.isDigit() function
description: strings.isDigit() tests if a single-character string is a digit (0-9).
url: https://docs.influxdata.com/flux/v0/stdlib/strings/isdigit/
estimated_tokens: 596
product: Flux
version: v0
publisher: InfluxData
canonical: https://docs.influxdata.com/flux/v0/stdlib/strings/isdigit/
date: '2024-04-08T16:01:02-06:00'
lastmod: '2024-04-08T16:01:02-06:00'
---

* Flux 0.18.0+

InfluxDB support

`strings.isDigit()` tests if a single-character string is a digit (0-9).

##### Function type signature

```js
(v: string) => bool
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### v

(Required)
Single-character string to test.

## Examples

### Filter by columns with digits as values

```js
import "strings"

data
    |> filter(fn: (r) => strings.isDigit(v: r._value))
```

[](#view-example-input-and-output)

View example input and output

#### Input data

|       \_time       |\_value|\*tag|
|--------------------|-------|-----|
|2021-01-01T00:00:00Z|   s   | t1  |
|2021-01-01T00:00:10Z|   n   | t1  |
|2021-01-01T00:00:20Z|   4   | t1  |
|2021-01-01T00:00:30Z|   4   | t1  |
|2021-01-01T00:00:40Z|   e   | t1  |
|2021-01-01T00:00:50Z|   y   | t1  |

|       \_time       |\_value|\*tag|
|--------------------|-------|-----|
|2021-01-01T00:00:00Z|   a   | t2  |
|2021-01-01T00:00:10Z|   p   | t2  |
|2021-01-01T00:00:20Z|   4   | t2  |
|2021-01-01T00:00:30Z|   t   | t2  |
|2021-01-01T00:00:40Z|   7   | t2  |
|2021-01-01T00:00:50Z|   v   | t2  |

#### Output data

|       \_time       |\_value|\*tag|
|--------------------|-------|-----|
|2021-01-01T00:00:20Z|   4   | t1  |
|2021-01-01T00:00:30Z|   4   | t1  |

|       \_time       |\_value|\*tag|
|--------------------|-------|-----|
|2021-01-01T00:00:20Z|   4   | t2  |
|2021-01-01T00:00:40Z|   7   | t2  |

#### Related

* [strings.isLetter() function](/flux/v0/stdlib/strings/isletter/)
| _time | _value | *tag |
| --- | --- | --- |
| _time | _value | *tag |
| 2021-01-01T00:00:00Z | s | t1 |
| 2021-01-01T00:00:10Z | n | t1 |
| 2021-01-01T00:00:20Z | 4 | t1 |
| 2021-01-01T00:00:30Z | 4 | t1 |
| 2021-01-01T00:00:40Z | e | t1 |
| 2021-01-01T00:00:50Z | y | t1 |

| _time | _value | *tag |
| --- | --- | --- |
| _time | _value | *tag |
| 2021-01-01T00:00:00Z | a | t2 |
| 2021-01-01T00:00:10Z | p | t2 |
| 2021-01-01T00:00:20Z | 4 | t2 |
| 2021-01-01T00:00:30Z | t | t2 |
| 2021-01-01T00:00:40Z | 7 | t2 |
| 2021-01-01T00:00:50Z | v | t2 |

| _time | _value | *tag |
| --- | --- | --- |
| _time | _value | *tag |
| 2021-01-01T00:00:20Z | 4 | t1 |
| 2021-01-01T00:00:30Z | 4 | t1 |

| _time | _value | *tag |
| --- | --- | --- |
| _time | _value | *tag |
| 2021-01-01T00:00:20Z | 4 | t2 |
| 2021-01-01T00:00:40Z | 7 | t2 |
