Number

See Also: Type Conversion Functions, Integer, Real, Round, String

Purpose

The Number function returns a value of type Number from an input of another type.

Return Type

Number

Syntax

(Number( {expression} ))

What It Does

Number eliminates the portion to the right of the eighth digit after the decimal point from the value of a variable.

Move (Number(3.14159265359)) To nPI

In this example, the value 3.14159265 is moved to the variable nPI. The digits more than eight places to the right of the decimal point are truncated.

The Number function does not change the type of its {expression} parameter. It only affects its precision.

When the absolute value of {expression} exceeds the maximum range of a DataFlex Number (+/-99,999,999,999,999.99999999), the leading digits in the value are truncated, and no error is declared.

Notes

 

Integer iMean

Number nResult

Move (3.14 * Number(iMean)) To nResult

This example would output 3.14 times the value of the integer variable iMean to the number variable nResult in the full precision of numbers.