Dec

Description

Converts a string to a decimal number or obtains a decimal value stored in a blob.

Syntax

Dec ( stringorblob )

Argument

Description

stringorblob

A string whose value you want returned as a decimal value or a blob in which the first value is the decimal you want. The rest of the contents of the blob is ignored. Stringorblob can also be an Any variable containing a string or blob.


Return value

Decimal.

Returns the value of stringorblob as a decimal. If stringorblob is not a valid PowerScript number or if it contains an incompatible datatype, Dec returns 0. If stringorblob is null, Dec returns null.

Examples

This statement returns 24.3 as a decimal datatype:

Dec("24.3")

This statement returns the contents of the SingleLineEdit sle_salary as a decimal number:

Dec(sle_salary.Text)

For an example of assigning and extracting values from a blob, see Real.

See also

Double

Integer

Long

Real