November 14th, 2000, 12:22 AM
how to format output of database into money format,ex: tou got form for entering number,then you want to fetch the result into money format like;
the problem is entry using integer so every format function will fail.
thanks in advance
great hope of palembang ,indonesia
November 14th, 2000, 05:19 AM
Read the manual.
echo "$" . number_format($integer);
(PHP 3, PHP 4 )
number_format -- Format a number with grouped thousands
string number_format (float number, int decimals, string dec_point, string thousands_sep)
Number_format() returns a formatted version of number. This function accepts either one, two or four parameters (not three):
If only one parameter is given, Number will be formatted without decimals, but with a comma (",") between every group of thousands.
If two parameters are given, number will be formatted with decimals decimals with a dot (".") in front, and a comma (",") between every
group of thousands.
If all four parameters are given, number will be formatted with decimals decimals, dec_point instead of a dot (".") before the decimals
and thousands_sep instead of a comma (",") between every group of thousands.