I'm really struggling to see how to do this. The following number is being posted:
As of <span id="theTime"></span> GMT, the gold price per ounce</a> in the UK is £'.$results['ounce_price'];
I want 'ounce_price' to be rounded to decimal places but can't figure how to do this.
Does 'round($results,2) ' mean anything in this situation? Where can I place the code. I'm a little confused, any help would be hugely appreciated!
Rounding to 2 Decimal Places
Moderator: General Moderators
Re: Rounding to 2 Decimal Places
After $results['ounce_price'] has been set you can do:
round($results['ounce_price'], 2);
round($results['ounce_price'], 2);
Re: Rounding to 2 Decimal Places
Perfect! Thank you very much, fixed the problem.
Re: Rounding to 2 Decimal Places
Welcome 