SUBTRACT

Function

Subtracts one value from another.

Syntax

SUBTRACT {src_num_lit|_var|_col} FROM dst_num_var[ROUND=nn]

Arguments

src_num_lit|_var|_col

Subtracted from the contents of dst_num_var.

dst_num_var

The result after execution.

ROUND

Rounds the result to the specified number of digits to the right of the decimal point. For float variables this value can be from 0 to 15. For decimal variables, this value can be from 0 to the precision of the variable. For integer variables, this argument is not appropriate.

Description

Subtracts the first value from the second and moves the result into the second field.

When dealing with money-related values (dollars and cents), use decimal variables rather than float variables. Float variables are stored as double precision floating point numbers, and small inaccuracies can appear when subtracting many numbers in succession. These inaccuracies can appear due to the way floating point numbers are represented by different hardware and software implementations.

Examples

subtract  1  from  #total      ! #total - 1
subtract &discount from #price ! #price - &discount

See Also