Documentation function

Flux 0.131.0+

The function is a user-contributed function maintained by the package author and can be updated or removed at any time. converts a hexadecimal string representation of a number to an integer.

import "contrib/bonitoo-io/hex" "4d2")

// Returns 1234



Value to convert.


Convert a hexadecimal string to an integer

import "contrib/bonitoo-io/hex" "-d431")

// Returns -54321

Convert all hexadecimal string values in a column to integers

  1. Use map() to iterate over and update all input rows.
  2. Use to update the value of a column.

The following example uses data provided by the sampledata package.

import "sampledata"

data =
  |> map(fn: (r) => ({ r with _value: hex.string(v: r._value) }))

  |> map(fn:(r) => ({ r with _value: r._value) }))

View input and output

Package author and maintainer

Github: @bonitoo-io, @sranka
InfluxDB Slack: @sranka

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.