SUBTRACT
Syntax
SUBTRACT {src_num_lit|_var|_col} FROM dst_num_var[ROUND=nn]
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 you are subtracting many numbers in succession. These inaccuracies can appear due to the way floating point numbers are represented by different hardware and software implementations.
Parameters
| Parameter | Description |
|---|---|
|
{src_num_lit | _var | _col} |
Is subtracted from the contents of dst_num_var. |
|
dst_num_var |
Contains 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 (zero) 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. |
Example
The following example shows the SUBTRACT command:
subtract 1 from #total ! #total - 1
subtract &discount from #price ! #price - &discount
See The ADD command for more
information
See The LET command for information
about complex arithmetic expressions