When displaying a number in a Web page, it’s nice to format the number in an easy-to-read way. For example, 123,456.78
is nicer to read than 123456.784321
.
PHP’s number_format()
function gives you an easy way to format numbers for displaying to the user. You can separate thousands with commas or other separators, choose the decimal point character, and choose the number of decimal places to display (or display no decimals at all).
[Read more…] about Formatting Numbers with PHP’s number_format() Function