---
title: "numberFormat"
manual: "TypoScript Explained"
version: "13.4"
permalink: "https://docs.typo3.org/permalink/t3tsref:numberformat@13.4"
source: "Functions/Numberformat.rst"
rendered: "2026-09-19T07:15:48+00:00"
---

# numberFormat {#numberformat}

With this property you can format a float value and display it as you
want, for example as a price. It is a wrapper for the `number_format()`
function of PHP.

You can define how many decimals you want and which separators you
want for decimals and thousands.

Since the properties are finally used by the PHP function
`number_format()`, you need to make sure that they are valid parameters
for that function. Consult the PHP manual, if unsure.

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

## Properties {#numberformat-properties}

### decimals {#numberformat-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 formatted number will have.

    Your input will in that case be rounded up or down to the next integer.

### dec_point {#numberformat-dec-point}

-   **dec_point**

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

    Character that divides the decimals from the rest of the number.

### thousands_sep {#numberformat-thousands-sep}

-   **thousands_sep**

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

    Character that divides the thousands of the number.
    Set an empty value to have no thousands separator.

## Examples {#numberformat-examples}

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

```typoscript
lib.myPrice = TEXT
lib.myPrice {
  value = 0.8
  stdWrap.numberFormat {
    decimals = 2
    dec_point.cObject = TEXT
    dec_point.cObject {
      value = .
      stdWrap.lang.de = ,
    }
  }
  stdWrap.noTrimWrap = || &euro;|
}
# Will basically result in "0.80 €", but for German in "0,80 €".

lib.carViews = CONTENT
lib.carViews {
  table = tx_mycarext_car
  select.pidInList = 42
  renderObj = TEXT
  renderObj {
    stdWrap.field = views
    # By default use 3 decimals or
    # use the number given by the Get/Post variable precisionLevel, if set.
    stdWrap.numberFormat.decimals = 3
    stdWrap.numberFormat.decimals.override.data = GP:precisionLevel
    stdWrap.numberFormat.dec_point = ,
    stdWrap.numberFormat.thousands_sep = .
  }
}
# Could result in something like "9.586,007".

```
