types.isNumeric() function

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
(v: A) => bool where A: Basic

For more information, see Function type signatures.

Parameters

v

(Required) Value to test.

Examples

Filter by numeric values

import "types"

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

View example input and output


Was this page helpful?

Thank you for your feedback!