PHP function number_format()

Availability in PHP 4.0

Format a number with grouped thousands

Parameters

Parameter Data type Default value Note
$number float not The number being formatted.
$decimals int 0 Sets the number of decimal points.
$dec_point string '.'

Return values

string

A formatted version of number.

Other resources

Official documentation of the number-format function

Newsletter

Nejlepsi tipy a triky o PHP do Vaseho e-mailu. Clanky a novinky nejen ze sveta PHP a programovani.