Formula Processor
In many areas of CAPITAL you are permitted to enter formulas or calculations in order to determine a stock price, tax rate, customer discount, etc. This field is usually referred to as the "formula" or "value" field.
Some of the areas where formulas can be entered include:
Formulas may take any of the following forms:
A set value. A formula may simply represent a value. For example, $12.50, $.50, etc.
A price field, i.e., A, B, H or special price field such as I.
Simple or complex algebra using set values and/or price fields.
Simple percentage expressions.
Acceptable formulas include:
15
23 / 54 + 2
C
A + (A * .11)
A + 11%
A + B
A / C + H
H * 10.123
If you wish to express a simple mark up or mark down on another price; for example, calculate price B and price A plus 15 per cent, the % symbol may be used as in:
A + 15%
C - 5%
The percentage symbol may not be used in more complex expressions. For example, A + C / 24 + 15% is NOT acceptable. (CAPITAL does not know in this case exactly what 15% is referring to and refuses to make assumptions.)
If you need to perform a complex calculation using a percentage, you must calculate the amount using multiplication. For example, the formula:
A + 20%
Can also be expressed as:
A + (A * .2)
When calculating tax, you may refer to the internal price field.
This is the sell price on each invoice or transaction line item or the cost price on purchase orders and returns. It is referred to as I. For example:
I * .15
Internal price fields are only available when associated with a transaction. If there is no transaction (such as in Stock Control pricing) then I will default to zero.
Result Rounding
By default the formula processor does not perform rounding on intermediate results when performing calculations. Humans often round results such as 2.013 to "2.01" and 2.052" to "2.05". If both of these numbers were added together without rounding off the last digits, the result would be 2.07 instead of 2.06. This is because the ".003" and ".002" portions would add up to ".005" and CAPITAL would then round this up to ".01" for the final presentation of the result.
If this effect is not desirable you can use the ROUND function. For example, the following formula is valid:
Round(C * .21, 2)
The
format is: ROUND(n, n). The first n is the formula to round, and the second n is the number of decimal
places to round up or round down to.
Digits below "5" are rounded down and digits "5" and above are rounded up, which is
in line with common mathematical practice.
The comma between the formula and the rounding number is mandatory.
![]() |