0

Hello

HOw do I format the output of my prices/numbers using number_format ()

In the code below I have the dynamic field from a recordset which shows the price. Currently the numbers are as such for example: 100000 and I would like them to be displayed as 100,000 or 1,000,000 etc

<?php echo $row_rs_search['prop_price']; ?>

Do I put the number_format() function here where the result is displayed?

So something like:

$price = $_POST[prop_price] number_format($price)<?php echo $row_rs_search['prop_price']; ?>

I suspect I might need the more advance version number_format (float $price [, int $decimals = 0] ?

Many thanks for the help

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by ebanbury
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.