# FormatArray

## Overview

![The FormatArray Node.](https://4267723012-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOEts3pBau6LMamSYhGZp%2Fuploads%2Fgit-blob-b4792304819de2165bb90020994ffdf147be007d%2Fformatarraynode.png?alt=media)

The **FormatArray** **Node** receives a **Pattern** **String** that can contain *format specifiers* and an **Array** containing data values. It then outputs the **String** formatted with the data values from the **Array** in place of the *format specifiers*. The *format specifiers* define the type of data that will fill them and the format the data will be shown in.

This **Node** is useful for when data needs to presented within a text. For example, to show the current temperature. For this, we can use the **Pattern** **String** `The current temperature is %.1f °C`, where `%.1f` is the *format specifier* that indicates that a **Float** value with one decimal place will take that position in the final formatted **String**. The value of the current temperature has to be given to the **Node** as a value in an **Array** and then, if the current temperature is, say, `20.3` degrees Celsius, the formatted **String** that the **Node** outputs will be `The current temperature is 20.3°C`.

See more about [*format specifiers*](https://docs.incari.com/incari-studio/2022.2/toolbox/format#format-specifiers) and [*usage examples*](https://docs.incari.com/incari-studio/2022.2/toolbox/format#usage-examples).

[**Scope**](https://docs.incari.com/incari-studio/2022.2/overview#scopes): **Project**, **Scene**, **Function**, **Prefab**.

## Attributes

![The FormatArray Node Attributes.](https://4267723012-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOEts3pBau6LMamSYhGZp%2Fuploads%2Fgit-blob-986acb372ca2794f431cbff450fba8a7027716e6%2Fformatarrayattributes.png?alt=media)

### Inputs

| Attribute         | Type       | Description                                                                 |
| ----------------- | ---------- | --------------------------------------------------------------------------- |
| `Default Pattern` | **String** | The **Pattern String**, if none is given in the `Pattern` **Input Socket**. |

## Inputs

| Input             | Type       | Description                                                                                |
| ----------------- | ---------- | ------------------------------------------------------------------------------------------ |
| *Pulse Input* (►) | **Pulse**  | A standard **Input Pulse**, to trigger the execution of the **Node**.                      |
| `Pattern`         | **String** | The **Pattern String**.                                                                    |
| `Values`          | **Array**  | **Array** containing the data values that will be used to replace the *format specifiers*. |

## Outputs

| Output             | Type       | Description                                                                                                                            |
| ------------------ | ---------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| *Pulse Output* (►) | **Pulse**  | A standard **Output Pulse**, to move onto the next **Node** along the **Logic Branch**, once this **Node** has finished its execution. |
| `Formatted`        | **String** | The formatted **String**, with the data values from the **Array** replacing the *format specifiers*.                                   |

## See Also

* [**Format Array**](https://docs.incari.com/incari-studio/2022.2/toolbox/string/formatarray)

## External Links

* [*Printf Format String*](https://en.wikipedia.org/wiki/Printf_format_string) on Wikipedia.
* [\_Printf](https://www.cplusplus.com/reference/cstdio/printf/) on cplusplus.com.
