projectdoc Toolbox

Execute a calculation in the context of a property value.

Identifier
projectdoc-property-calculation-macro
Since
6.0

The macro runs a calculation and renders the result. It can be used in the context of a property value.

It references the properties of the current document (the document it is specified on) and the homepage of the space this document is part of as sources for property values. The space homepage can be replaced by another projectdoc document.

Parameters

The macro is configured by the following parameters.

Document

Specify a document to provide default property values.

If not specified, this defaults to the space homepage.

Note that only properties from the document are used. Not the space properties, as this would require a search and would prevent the use of this macro as a property value.

Format

Specify the format to render the number value.

The value is a valid number format in Java and defaults to decimal.

Valid values are integer, decimal, currency, and anything that can be parsed by DecimalFormat.

Macro Body

The body of the macro contains the formula with placeholders (${...}), which refer to property values. These properties are either defined on the given document or in the referenced document with the Document parameter.

Details

Double Precision

All calculations are run with double precision, therefore the macro is not suitable for formulas require with discrete values, not allowing limited precision.

For instance use cases requiring calculations based on currencies (integer values) are not supported.

Related Macros

Calculation Macro
Run calculations on a set of result documents and renders the results.
Calculation Result Macro
Renders a single result of a calculation provided by the Calculation Macro.

References

Evidence for the information is available by the following references.

Limitations on Query Results
The number of hits for document queries is limited due to performance reasons.