real(X)

Returns the given value cast to decimal data type.

Syntax

real(X)

Input

Argument Type Description
X any simple type The value to cast

Return Value

Returns the value of X cast to decimal data type.

If X is an integer or decimal number represented as text, it is cast to decimal data type.

If X is N/A, the result is N/A.

Example

In this example, the real(X) function returns the values of the store (integer), sku (text), and sales (decimal) columns cast to the decimal data type on the pub.demo.retail.item table.

<base table="pub.demo.retail.item"/>
<colord cols="transid, store, sku, sales"/>
<willbe name="realstore" value="real(store)"/>
<willbe name="realsku" value="real(sku)"/>
<willbe name="realsales" value="real(sales)"/>