---
title: types.isNumeric() function
description: types.isNumeric() tests if a value is a numeric type (int, uint, or float).
url: https://docs.influxdata.com/flux/v0/stdlib/types/isnumeric/
estimated_tokens: 892
product: Flux
version: v0
publisher: InfluxData
canonical: https://docs.influxdata.com/flux/v0/stdlib/types/isnumeric/
date: '2024-04-08T16:01:02-06:00'
lastmod: '2024-04-08T16:01:02-06:00'
---

* Flux 0.187.0+

InfluxDB support

`types.isNumeric()` tests if a value is a numeric type (int, uint, or float).

This is a helper function to test or filter for values that can be used in
arithmetic operations or aggregations.

##### Function type signature

```js
(v: A) => bool where A: Basic
```

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

## Parameters

### v

(Required)
Value to test.

## Examples

### Filter by numeric values

```js
import "types"

data
    |> filter(fn: (r) => types.isNumeric(v: r._value))
```

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

View example input and output

#### Input data

|       \_time       |\*type|\_value|
|--------------------|------|-------|
|2021-01-01T00:00:00Z|float |\-2.18 |
|2021-01-01T00:00:10Z|float | 10.92 |
|2021-01-01T00:00:20Z|float | 7.35  |

|\_time|\*type|\_value|
|------|------|-------|

|       \_time       |\*type|\_value|
|--------------------|------|-------|
|2021-01-01T00:00:00Z| bool | true  |
|2021-01-01T00:00:10Z| bool | true  |
|2021-01-01T00:00:20Z| bool | false |

|\_time|\*type|\_value|
|------|------|-------|

|       \_time       |\*type|  \_value   |
|--------------------|------|------------|
|2021-01-01T00:00:00Z|string|smpl\_g9qczs|
|2021-01-01T00:00:10Z|string|smpl\_0mgv9n|
|2021-01-01T00:00:20Z|string|smpl\_phw664|

|\_time|\*type|\_value|
|------|------|-------|

|       \_time       |\*type|\_value|
|--------------------|------|-------|
|2021-01-01T00:00:00Z| int  |  \-2  |
|2021-01-01T00:00:10Z| int  |  10   |
|2021-01-01T00:00:20Z| int  |   7   |

#### Output data

|       \_time       |\*type|\_value|
|--------------------|------|-------|
|2021-01-01T00:00:00Z|float |\-2.18 |
|2021-01-01T00:00:10Z|float | 10.92 |
|2021-01-01T00:00:20Z|float | 7.35  |

|\_time|\*type|\_value|
|------|------|-------|

|       \_time       |\*type|\_value|
|--------------------|------|-------|
|2021-01-01T00:00:00Z| int  |  \-2  |
|2021-01-01T00:00:10Z| int  |  10   |
|2021-01-01T00:00:20Z| int  |   7   |

[types](/flux/v0/tags/types/)[tests](/flux/v0/tags/tests/)
| _time | *type | _value |
| --- | --- | --- |
| _time | *type | _value |
| 2021-01-01T00:00:00Z | float | -2.18 |
| 2021-01-01T00:00:10Z | float | 10.92 |
| 2021-01-01T00:00:20Z | float | 7.35 |

| _time | *type | _value |
| --- | --- | --- |
| _time | *type | _value |

| _time | *type | _value |
| --- | --- | --- |
| _time | *type | _value |
| 2021-01-01T00:00:00Z | bool | true |
| 2021-01-01T00:00:10Z | bool | true |
| 2021-01-01T00:00:20Z | bool | false |

| _time | *type | _value |
| --- | --- | --- |
| _time | *type | _value |

| _time | *type | _value |
| --- | --- | --- |
| _time | *type | _value |
| 2021-01-01T00:00:00Z | string | smpl_g9qczs |
| 2021-01-01T00:00:10Z | string | smpl_0mgv9n |
| 2021-01-01T00:00:20Z | string | smpl_phw664 |

| _time | *type | _value |
| --- | --- | --- |
| _time | *type | _value |

| _time | *type | _value |
| --- | --- | --- |
| _time | *type | _value |
| 2021-01-01T00:00:00Z | int | -2 |
| 2021-01-01T00:00:10Z | int | 10 |
| 2021-01-01T00:00:20Z | int | 7 |

| _time | *type | _value |
| --- | --- | --- |
| _time | *type | _value |
| 2021-01-01T00:00:00Z | float | -2.18 |
| 2021-01-01T00:00:10Z | float | 10.92 |
| 2021-01-01T00:00:20Z | float | 7.35 |

| _time | *type | _value |
| --- | --- | --- |
| _time | *type | _value |

| _time | *type | _value |
| --- | --- | --- |
| _time | *type | _value |
| 2021-01-01T00:00:00Z | int | -2 |
| 2021-01-01T00:00:10Z | int | 10 |
| 2021-01-01T00:00:20Z | int | 7 |
