Instance Property

floatValue

The floating-point value of the string as a float.

Declaration

var floatValue: Float { get }

Discussion

This property doesn’t include whitespace at the beginning of the string. This property is HUGE_VAL or –HUGE_VAL on overflow, 0.0 on underflow. This property is 0.0 if the string doesn’t begin with a valid text representation of a floating-point number.

This method uses formatting information stored in the non-localized value; use an Scanner object for localized scanning of numeric values from a string.

See Also

Getting Numeric Values

var doubleValue: Double

The floating-point value of the string as a double.

var intValue: Int32

The integer value of the string.

var integerValue: Int

The NSInteger value of the string.

var longLongValue: Int64

The long long value of the string.

var boolValue: Bool

The Boolean value of the string.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software