Search code examples
phpphp4

How to round a decimal number to nearest 5 or nearest 10 in php


How to round a decimal number to nearest 5 or nearest 10 in php


Solution

  • $new = round($num / 10, 0) * 10 rounds to nearest 10