---
title: "round"
manual: "TypoScript Explained"
version: "13.4"
permalink: "https://docs.typo3.org/permalink/t3tsref:round@13.4"
source: "Functions/Round.rst"
rendered: "2026-09-18T10:44:33+00:00"
---

# round {#round}

With this property you can round the value up, down or to a certain
number of decimals. For each roundType the according PHP function will
be used.

The value will be converted to a float value before applying the
selected round method.

-   [Properties](https://docs.typo3.org/permalink/t3tsref:properties@13.4)
-   [Examples](https://docs.typo3.org/permalink/t3tsref:examples@13.4)

## Properties {#round-properties}

### roundType {#round-roundtype}

-   **roundType**

    -   *Type:* [string](https://docs.typo3.org/permalink/t3tsref:data-type-string@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)
    -   *Default:* round

    Round method which should be used.

    Possible keywords:

    -   **ceil**

        Round the value up to the next integer.

    -   **floor**

        Round the value down to the previous integer.

    -   **round**

        Round the value to the specified number of decimals.

### decimals {#round-decimals}

-   **decimals**

    -   *Type:* [integer](https://docs.typo3.org/permalink/t3tsref:data-type-integer@13.4) / [stdWrap](https://docs.typo3.org/permalink/t3tsref:stdwrap@13.4)
    -   *Default:* 0

    Number of decimals the rounded value will have. Only used with the
    roundType "round". Defaults to 0, so that your input will in that case
    be rounded up or down to the next integer.

### round {#round-round}

-   **round**

    -   *Type:* [boolean](https://docs.typo3.org/permalink/t3tsref:data-type-boolean@13.4)
    -   *Default:* 0

    Set round = 1 to enable rounding.

## Examples {#round-examples}

**EXT:site_package/Configuration/TypoScript/setup.typoscript**

```typoscript
lib.number = TEXT
lib.number {
  value = 3.14159
  stdWrap.round = 1
  stdWrap.round.roundType = round
  stdWrap.round.decimals = 2
}

```

This returns `3.14`.
