toFloat() function
The toFloat()
function converts all values in the _value
column to floats.
toFloat()
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
- string (numeric, scientific notation, infinity, or NaN)
- boolean
- int
- uint
Parameters
tables
Input data.
Default is piped-forward data (<-
).
Examples
The following examples use data provided by the sampledata
package
to show how toFloat()
transforms data.
Convert an integer value column to a float column
import "sampledata"
sampledata.int()
|> toFloat()
Convert a boolean value column to a float column
import "sampledata"
sampledata.bool()
|> toFloat()
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, the following resources are available:
InfluxDB Cloud customers can contact InfluxData Support.