number_format

 

Kurzbeschreibung

Formatiert eine Zahl mit Tausender-Gruppierung.

Funktionsbeschreibung

number_format( float $_number , int $_decimals = 0 , string $_decPoint = '.' , string $_thousandsPoint = ',' ) : string

Beispiele

{% $_number = 1234.56 %} {# english notation (default) #} {% $_english_format_number = number_format($_number) %} {# 1,235 #} {# French notation #} {% $_nombre_format_francais = number_format($_number, 2, ',', ' ') %} {# 1 234,56 #} {% $_number = 1234.5678 %} {# english notation without thousands separator #} {% $_english_format_number = number_format($_number, 2, '.', '') %} {# 1234.57 #}
Nach oben