formatValue
function formatValue(value, settings?): string;Defined in: packages/engine/src/format/FormatEngine.ts:267
Render an evaluated Value as a display string, dispatching on
value.type to the type-specific formatter (number, hex, datetime, unit
of measurement, matrix, range, percentage, …).
Most branches produce a "= "-prefixed result string (matching the
plugin’s inline-result convention); ValueType.Error is the one
exception, it returns the human-readable error message directly
(stored in value.unit), not an "= "-prefixed string.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | Value | The evaluated value to format. |
settings? | FormattingSettings | Locale/precision/separator options; defaults to DEFAULT_FORMATTING_SETTINGS when omitted. |
Returns
Section titled “Returns”string
Example
Section titled “Example”const [value] = engine.evaluateExpression("10 USD to GBP");formatValue(value); // "= £7.85" (exact output depends on live exchange rates)