Scalar. Converts a given value to a float.
to_float ( value )
value | A string, interval, date/time type, numeric type, or money type. |
Converts a given value to a float. The function takes a string, interval, date/time type, numeric type, or money type as its argument, and the function returns a float . Note that the function can also take a float as its argument, but it will return the same float value.
A string converts based on the format for a float literal. An interval returns a value representing a number of microseconds. A date/time type returns a value representing the number of seconds, milliseconds, or microseconds from the epoch (midnight, January 1, 1970 UTC) depending on whether the input type is a date, timestamp or bigdatetime respectively. Those date/time types prior to the epoch convert to a negative value.
to_float ('100.0')returns 100.0.