Jump to content

[SOLVED] rounded numbers...


pfkdesign

Recommended Posts

hi everybody.

i have problem with rounding and i wounder if you can help me.

i want to round numbers which rounded down if it is less than *5, and round up if greater than *5

ex.

if there are between 10-14 shows 10, 

15-19 shows 20

14 -> 15

12 -> 10

9 -> 10...

$current= date('Y');
$yeasexperience= $row_rsexperience['years_ex'];
$total= $current - $yeasexperience; 
echo round($total);
echo " years of experience";

 

any idea?

Link to comment
https://forums.phpfreaks.com/topic/122515-solved-rounded-numbers/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.