---
title: "Format.printf ViewHelper <f:format.printf>"
manual: "Fluid Explained"
version: "main"
permalink: "https://docs.typo3.org/permalink/fluid:typo3fluid-fluid-format-printf"
source: "ViewHelpers/Fluid/Format/Printf.rst"
rendered: "2026-10-08T14:12:40+00:00"
---

# Format.printf ViewHelper `<f:format.printf>` {#typo3fluid-fluid-format-printf}

> [!NOTE]
> This reference is part of the documentation of Fluid Standalone.
> If you are working with Fluid in TYPO3 CMS, please refer to
> [TYPO3's ViewHelper reference](https://docs.typo3.org/other/typo3/view-helper-reference/14.3/en-us/Global/Format/Printf.html) instead.

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 {#examples}

### Scientific notation {#scientific-notation}

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

```

Output:

```php
3.625e+8

```

### Argument swapping {#argument-swapping}

```php
<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:

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

```

### Single argument {#single-argument}

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

```

Output:

```php
We love TYPO3

```

### Inline notation {#inline-notation}

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

```

Output:

```php
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
