MetaTool > Help > Extraction > Calculate Number
060-690 MetaTool Extraction Edit – Calculate Number
With the MetaTool Calculate Number rule, you can add, subtract, divide or multiply two values. For example you can calculate a Total before tax or a price after discount.
You typically extract the full text with an OCR extraction rule first. Next, you would find and format the Total on the document and define a Calculate Number rule.
01 Calculate Number – Add Rule
Calculate Number is defined in the MetaTool Extract tab.
Press the Add button and select Edit – Calculate – Number to add the edit rule.
02 Calculate Number – Setup
In our example we will make use of the CB MetaTool Keyword Doc Sep job. This job is automatically installed when you install CaptureBites MetaTool.
We want to calculate the total amount after a 2% discount for early payment. The total amount is located on the last page of the inspection reports.
We first add an Advanced OCR rule for the index field “Full Text Last Page”. Next we find and format the Total Due from each document. Refer to the help pages of the Find word with Mask / Words, Find line with Mask / Words, Find number and Replace text rule for more details.
Finally, we define the Calculate Number rule. We select the index field that will hold the final result, in this case, “Total Due Early Payment”.
Optionally, we enter a description.
07 – Decimal symbol: here you enter the decimal symbol used in the Source field value and Value, in our example we use the “.” as decimal symbol.
09 – Round down: enable this option to round a value like 10.5555 to 10.55. When disabled, the values are rounded up, so 10.5555 will become 10.56. This option only influences the result if the decimal after the last significant decimal position equals 5.
For example: 10.5545 is always rounded to 10.55 and 10.5565 will always be rounded to 10.56 regardless of the option’s state.