Skip to content

Profectus / data/common / createFormulaPreview

Function: createFormulaPreview() ​

createFormulaPreview(formula, showPreview, previewAmount): ComputedRef<Element>

Utility function for displaying the result of a formula such that it will, when told to, preview how the formula's result will change. Requires a formula with a single variable inside.

Parameters ​

formula ​

GenericFormula

The formula to display the result of.

showPreview ​

MaybeRefOrGetter<boolean>

Whether or not to preview how the formula's result will change.

previewAmount ​

MaybeRefOrGetter<DecimalSource> = 1

The amount to add to the current formula's variable amount to preview the change in result.

Returns ​

ComputedRef<Element>

Defined in ​

profectus/src/data/common.tsx:450