try this
print(number_format($price, 2));
Question
i have field "price" with type Decimals in my mysql database table, the value is 200000.00
but if i fetch in to my website using PHP, it always showing 0.00 i already double check and make sure my query and fetch script correct
is there a specific way to fetch decimal to php ?
This is my code
$query_price = mysql_query("SELECT * FROM `tblpricing` WHERE `relid`='2' AND `currency`='1'");
$fetch_price = mysql_fetch_array($query_price);
$priceun = "$fetch_price[annually]";
thank you
La solution
try this
print(number_format($price, 2));