Menu Samaritan's Purse

NUMBER_FORMAT

Format a number with grouped thousands

SYNTAX

number_format ( float $number [, int $decimals = 0 ] ) : string
number_format ( float $number , int $decimals = 0 , string $dec_point = "." , string $thousands_sep = "," ) : string

PARAMETERS

number

The number being formatted.

decimals

Sets the number of decimal points.

dec_point

Sets the separator for the decimal point.

thousands_sep

Sets the thousands separator.

RETURN

A formatted version of number.

EXAMPLES

NUMBER

1,235

DECIMALS

1,234.56

DEC_POINT THOUSANDS_SEP

1 234,56

PHP