Shorten variable to 100th decimal place
Posted on 2011-09-05
I have a variable, $item_price, whose value is 55.0000
I want to shorten the number to the 100th place. I was trying to do the following but do not get output when I echo $item_price2. I wonder if I need to convert this value from a string to a number?? Thoughts?
$item_price2 = number_format($item_price, 2, '.', '');