Categories:

# AS_DOUBLE , AS_REAL¶

Casts a VARIANT value to a floating-point value.

AS_REAL is a synonym for AS_DOUBLE.

## Syntax¶

AS_DOUBLE( <variant> )

AS_REAL( <variant> )


## Arguments¶

variant

This should be an expression that evaluates to a VARIANT that contains a valid floating-point value.

## Examples¶

Here is a valid (although inefficient) way to calculate the area of a circle with radius 2 by using the AS_DOUBLE() function:

Create and fill a table:

CREATE TABLE demo (radius DOUBLE, v_radius VARIANT);
INSERT INTO demo (radius) VALUES (2.0);

SELECT pi() * AS_DOUBLE(v_radius) * AS_DOUBLE(v_radius) AS area1,