Link to home
Start Free TrialLog in
Avatar of rameshitm
rameshitm

asked on

Find nearest number php

How to find the nearest tenth number in php.
Example: if input is 58, output should be 60
if input is 92, the output should be 90

Thanks.
Avatar of Rgonzo1971
Rgonzo1971

Hi,

pls try

$number = round($input / 10) * 10;

Regards
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial