toUInt() function

The toUInt() function converts all values in the _value column to UIntegers.


To convert values in a column other than _value, define a custom function patterned after the function definition, but replace _value with your desired column.

Supported data types
  • bool
  • duration
  • float
  • int
  • string (numeric)
  • time

toInt() behavior depends on the _value column data type:

_value type Returned value
bool 1 (true) or 0 (false)
duration Number of nanoseconds in the specified duration
float UInteger equivalent of the float value truncated at the decimal
int UInteger equivalent of the integer
string UInteger equivalent of the numeric string
time Equivalent nanosecond epoch timestamp



Input data. Default is piped-forward data (<-).


The following examples use data provided by the sampledata package to show how toUInt() transforms data.

Convert a float value column to a uinteger column

import "sampledata"

    |> toUInt()

View input and output

Convert a boolean value column to a uinteger column

import "sampledata"

    |> toUInt()

View input and output

Convert a uinteger value column to a integer column

import "sampledata"

    |> toUInt()

View input and output

Was this page helpful?

Thank you for your feedback!

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.