Php number format
From w3cyberlearnings
Contents |
PHP function number_format
This function formats a given number with grouped thousands.
Syntax number_format
- number: number input
- decimals: format of a decimal point.
- dec_point: decimal point separator.
- thousand_sep: the thousands separator.
number_format(number, decimals, dec_point, thousand_sep);
Example 1
<?php echo number_format("200000"); ?>
Output
200,000
Example 2
<?php echo number_format("2880183",2,",","."); ?>
Output
2.880.183,00