Complete PHP String Reference
The money_format() function returns a string formatted as a currency string.
This function inserts a formatted number where there is a percent (%) sign in the main string.
| Parameter | Description |
|---|---|
| string | Required. Specifies the string to be formatted and how to format the variables in it. Possible format values: Padding and Flags:
Field width:
Conversion characters:
Note: If multiple format values are used, they must be in the same order as shown above. Note: This function is affected by local settings. |
| number | Required. The number to be inserted at the %-sign in the format string |
Note: The money_format() function does not work on Windows platforms.
International en_US format:
The output of the code above will be:
National Norwegian format with 2 decimals:
The output of the code above will be:
Negative number, US national format with () to indicate negative numbers and 2 digits of right precision and "*" as fill character:
The output of the code above will be:
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|