> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/flow/tutorials/components/metric/format-money-percent-and-dates.md).

# Format money, percent and dates

Format a Metric as money with the right currency, as a percent that reads as the user expects, or as a date, using Format Style and its options.

The forecast screen carries three numbers: the revenue won this quarter, the win rate, and the next close date in the pipeline. Each one needs its own format, or the rep reads `482500`, `0.42` and `2026-11-28` and has to work out what they mean. Put each number in its own Metric and give each one its own **Format Style**.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FHxibDBgdcv64Vm6uSNnv%2Fmetric-format-result.png?alt=media" alt="Three Avonni Metrics on a flow screen: Won This Quarter US$482,500, Win Rate 42%, Next Close Date Sat, Nov 28, 2026" width="450"><figcaption><p>One component, three Format Styles: currency, percent and a written-out date.</p></figcaption></figure>

## Before you start

* A screen with three **Avonni Metric** components. [Metric](https://docs.avonnicomponents.com/flow/flow-components/metric.md) covers adding them.
* A value for each. The revenue can come from a query, as in [Show a KPI from a query](https://docs.avonnicomponents.com/flow/tutorials/components/metric/show-a-kpi-from-a-query.md). The win rate can be typed in for this tutorial.

## Steps

{% stepper %}
{% step %}

### Format the revenue as money

On the first Metric, in **Primary Metric**:

* **Format Style**: **Currency**.
* **Currency Code**: `USD`. Use the ISO code of the currency the amounts are in. The Metric formats the amount and does no conversion.
* **Currency Display As**: **Symbol** shows `$482,500`. **Code** shows `USD 482,500`, which removes doubt when several currencies use `$`. The symbol follows the user's locale: a user with a Canadian locale sees `US$482,500`.
* **Maximum Fraction Digits**: `0`. Cents add nothing to a quarterly total.

Set **Label** to `Won This Quarter`.
{% endstep %}

{% step %}

### Choose Percent or Percent Fixed for the win rate

On the second Metric, the choice depends on how the number is stored:

| Your value            | Format Style      | Shows |
| --------------------- | ----------------- | ----- |
| A ratio, `0.42`       | **Percent**       | `42%` |
| A whole percent, `42` | **Percent Fixed** | `42%` |

A Salesforce Percent field stores `42` for 42%, so it goes with **Percent Fixed**. A formula such as `{!WonCount} / {!ClosedCount}` returns a ratio and goes with **Percent**. Set **Value** to `42` with **Percent Fixed**, and **Label** to `Win Rate`.
{% endstep %}

{% step %}

### Format the next close date

On the third Metric, set **Format Style** to **Date**. **Value** now takes a date. Pick **Query**, choose **Opportunity**, `CloseDate` as the **Field**, **Minimum** as the **Aggregate Function**.

Switch **Filters** to **Mapped** and select a Text formula resource whose value is `"IsClosed = false AND CloseDate >= TODAY"`, so overdue close dates are left out.

Then build the date from its parts. Each option you set adds that part, and an empty option leaves it out:

* **Day**: **numeric**, **Month**: **Short**, **Year**: **numeric**, **Weekday**: **Short** show `Sat, Nov 28, 2026`.
* **Month**: **Long** and **Year**: **numeric** alone show `November 2026`.
* **Timezone**: `UTC`. A Salesforce date has no time zone, and without this setting users west of UTC see the day before.

Set **Label** to `Next Close Date`.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FgA47or8phfyOljDuv0Hq%2Fmetric-format-date-panel.png?alt=media" alt="Metric date options in the Flow Builder panel: Day numeric, Month Short, Year numeric, Weekday Short" width="320"><figcaption><p>The four date options that write the close date out as weekday, month, day and year.</p></figcaption></figure>
{% endstep %}

{% step %}

### Show the sign on a change

When a value can go up or down, such as a change against last quarter, set **Value Sign** to **Positive and Negative**. Growth then shows `+12%` instead of `12%`, and the reader sees the direction without a color. **Negative Only**, the default, shows a sign on drops only.
{% endstep %}

{% step %}

### Save and test

Run the flow with **Debug**. The screen shows `$482,500`, `42%` and the next close date written out, each under its label.
{% endstep %}
{% endstepper %}

## Related tutorials

* [Show a KPI from a query](https://docs.avonnicomponents.com/flow/tutorials/components/metric/show-a-kpi-from-a-query.md): where the revenue value comes from.
* [Add a trend against a target](https://docs.avonnicomponents.com/flow/tutorials/components/metric/add-a-trend-against-a-target.md): color the formatted value against a target.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/flow/tutorials/components/metric/format-money-percent-and-dates.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
