I need to round a number to two decimal places. Here's the code. What is the correct code to round to two decimal places? $ctr= round(($row['number_clicks']/$row['impression'])*100) . "%"; PHP: Thanks! ~Adam
Click on the link in your code. $ctr= round(($row['number_clicks']/$row['impression'])*100, 2) . "%"; PHP:
Ah, thanks...somehow I missed that info in the manual the first time I read it. else $ctr= round(($row['number_clicks']/$row['impression'])*100, 2) . "%"; PHP:
Sometimes number_format can be useful too. I use it to format currencies and percentages too. Good luck!