i'm curious how something like this would work
class Test
{
public $price;
}
$obj = new Test();
$obj->price = 4500.00;
echo $obj->price;
how can I return that value as 4500.00
and not 4500
?
i'm curious how something like this would work
class Test
{
public $price;
}
$obj = new Test();
$obj->price = 4500.00;
echo $obj->price;
how can I return that value as 4500.00
and not 4500
?
echo number_format($obj->price,2);
If you don't what the thousands seperator:
echo number_format($obj->price,2,'.','');
See number_format