Decimal support in DataWindow expressions

Description

PowerBuilder provides a variety of ways to work with decimal values in DataWindow expressions.

Usage

The following arithmetic operators now return a decimal value if both operands have a datatype of decimal:   

Operator

Meaning

Example

+

Addition

Subtotal + Tax

-

Subtraction

Price - Discount

*

Multiplication

Quantity*Price

/

Quantity*Price

Quantity*Price


If either operand is not a decimal, the returned value is converted to a double datatype. The exponentiation operator (^) returns a double

Relational operators that operate on numeric values, including =, >, <, <>, >=, and <=, can take decimal operands. The precision of the decimal operand is maintained in comparisons.

The following functions return a decimal datatype if their arguments are decimals: Sum, CumulativeSum, Avg, Median, Count, First, Last, Max, Min, Large, Small, Var, VarP, Mod, Mode, Abs, Case, If.

The following functions return a decimal result instead of a double: CrosstabAvgDec, CrosstabMaxDec, CrosstabMinDec, and CrosstabSumDec.

The Dec function converts a constant string to a decimal.

The Specify Retrieval Arguments dialog box includes the Decimal and Decimal array types.

See also

Dec