Introduction
In this article I describe the PHP string functions number_format, ord and parse_str. To learn some other math functions, go to:
- String Functions in PHP: Part1
- String Functions in PHP:Part2
- String Functions in PHP:Part3
- String Functions in PHP:Part4
- String Functions in PHP:Part5
- String Functions in PHP:Part6
- String Functions in PHP:Part7
- String Functions in PHP:Part8
- String Functions in PHP:Part9
- String Functions in PHP:Part10
PHP number_format() Function
The PHP number_format function is used to set the format of numeric output.
Syntax
| number_format (number,decimals,decimalpoint, separator) |
Parameter in number_format Function
The parameters of the money_format function are:
| Parameter | Description |
| number | It specifies the number to be formatted. |
| decimals | It sets the number of decimal points. |
| decimalpoint | It specifies what string is used for the decimal point. |
| separator | It sets the thousands separator. |
Example
An example of the number_format function is:
<?php
echo number_format("999999");
echo "<br />";
echo number_format("999999",2);
echo "<br />";
echo number_format("1000000",2,",",".");




Join the conversation! Your thoughts help the community grow.