---
title: "Format.printf ViewHelper <f:format.printf>"
manual: "Fluid ViewHelper Reference"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3viewhelper:typo3fluid-fluid-format-printf@main"
source: "Global/Format/Printf.rst"
modified: "2026-09-15T08:11:10+00:00"
---

# Format.printf ViewHelper `<f:format.printf>`

A ViewHelper for formatting values with printf. Either supply an array for
the arguments or a single value.

See [http://www.php.net/manual/en/function.sprintf.php](http://www.php.net/manual/en/function.sprintf.php)

## Examples

### Scientific notation

```
<f:format.printf arguments="{number: 362525200}">%.3e</f:format.printf>

```

Output:

```
3.625e+8

```

### Argument swapping

```
<f:format.printf arguments="{0: 3, 1: 'Kasper'}">%2$s is great, TYPO%1$d too. Yes, TYPO%1$d is great and so is %2$s!</f:format.printf>

```

Output:

```
Kasper is great, TYPO3 too. Yes, TYPO3 is great and so is Kasper!

```

### Single argument

```
<f:format.printf arguments="{1: 'TYPO3'}">We love %s</f:format.printf>

```

Output:

```
We love TYPO3

```

### Inline notation

```
{someText -> f:format.printf(arguments: {1: 'TYPO3'})}

```

Output:

```
We love TYPO3
```

Go to the source code of this ViewHelper: [Format\\PrintfViewHelper.php (GitHub)](https://github.com/TYPO3/Fluid/blob/main/src/ViewHelpers/Format/PrintfViewHelper.php).

**Arguments**

The following arguments are available for the format.printf ViewHelper:

-   **arguments**

    -   *Type:* array
    -   *Default:* array (
    )

    The arguments for vsprintf

-   **value**

    -   *Type:* string

    String to format
