- Processing
- p5.js
- Processing.py

- Processing Foundation

This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Javadoc.

Name | ### float()
Examples |
    int i = 65;
    float f = float(i);
    println(i + " : " + f);  // Prints "65 : 65.0"
Description | Converts an int or String to its floating point representation. An int is easily converted to a float, but the contents of a String must resemble a number, or NaN (not a number) will be returned. For example, float("1234.56") evaluates to 1234.56, but float("giraffe") will return NaN. When an array of int or String values is passed in, then a floating point array of the same length is returned.

Updated on June 20, 2015 10:37:41pm UTC