---
title: "number_format für Typoscript?"
url: "https://www.typo3.net/d/89143-number-format-fuer-typoscript"
source: "typo3.net"
tags: ["TYPO3","TypoScript","Frage"]
created: "2009-04-24"
last_reply: "2010-03-23"
replies: 6
solved: false
page: 1
pages: 1
lang: "de"
---

# number_format für Typoscript?

TYPO3 › TypoScript · 6 Antworten · gestartet 2009-04-24

## Eröffnungsbeitrag

**einpraegsam.​net** · 2009-04-24 · [Beitrag #1](https://www.typo3.net/d/89143-number-format-fuer-typoscript/1)

Kennt jemand etwas, damit man Zahlen vernünftig ausgeben kann? Eben eine ähnliche Funktion wie number_format() in PHP

Grüße, Alex

## Antworten

### [#2](https://www.typo3.net/d/89143-number-format-fuer-typoscript/2) · just2b · 2009-04-24

außer ner postUserFunction, nö...  es gäbe nur was für die größe und fürs alter

georg

### [#3](https://www.typo3.net/d/89143-number-format-fuer-typoscript/3) · einpraegsam.​net · 2009-04-24

> **just2b schrieb:**
>
> außer ner postUserFunction, nö...  es gäbe nur was für die größe und fürs alter

Na du gehst wohl nie schlafen?  :D

### [#4](https://www.typo3.net/d/89143-number-format-fuer-typoscript/4) · just2b · 2009-04-24

dochdoch, musste nur gestern wieder mal bisschen was nettes machen ;)

### [#5](https://www.typo3.net/d/89143-number-format-fuer-typoscript/5) · einpraegsam.​net · 2009-04-24

Hier mal eine userFunc zu number_format:

```php
class user_misc {
	public function number_format2($content = '', $conf = array()) {
		global $TSFE;
    	$local_cObj = $TSFE->cObj; // cObject
		$conf = $conf['userFunc.']; // TS configuration
		
		$number = $local_cObj->cObjGetSingle($conf['number'], $conf['number.']); // get number
		return number_format($number, $conf['decimal'], $conf['dec_point'], $conf['thousands_sep']);
	}

}
```

Beispiel Einbindung:

```typoscript
includeLibs.user_misc = fileadmin/user_misc.php

lib.object = USER
lib.object {
	userFunc = user_misc->number_format2
	userFunc {
		number = TEXT
		number.value = 55
		
		decimal = 2
		dec_point = ,
		thousands_sep = .
	}
}
```

### [#6](https://www.typo3.net/d/89143-number-format-fuer-typoscript/6) · just2b · 2009-04-25

mach doch nen RFC für stdWrap, das wär doch was!

lg georg

### [#7](https://www.typo3.net/d/89143-number-format-fuer-typoscript/7) · Daviz · 2010-03-23

Da habe ich gerade eine ältere Extension gefunden, die genau das macht:
[am_stdwrap_numberformat](http://typo3.org/extensions/repository/view/am_stdwrap_numberformat/current/)

Funktioniert bei einem ersten Test auch noch unter 4.2.x gut.

---

Quelle: „number_format für Typoscript?“, typo3.net, https://www.typo3.net/d/89143-number-format-fuer-typoscript
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
