PHP function money_format()

Availability in versions: PHP 4.3.0

Formats a number as a currency string

Parameters

Parameter Data type Default value Note
$format string not The format specification consists of the following sequence:

a % character

$number float not The number to be formatted.

Return values

string

the formatted string. Characters before and after the formatting string will be returned unchanged. Non-numeric number causes returning &null; and emitting E_WARNING.

Other resources

Official money-format documentation

Newsletter

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