Skip to content

The Lazy Web Dev

Snippets and Tips for Web Developers

Recent Posts

  • mysqldump: Got errno 11 on write
  • Yandex Webmaster Tools
  • Magento 2 – Clearing the blasted caches and static files
  • New to development for Magento 2? You should read Alan Storm’s book
  • Magento 1.9 – Add hreflang tags via XML custom layout panel in admin

Categories

  • CSS (1)
  • Errors (3)
  • General tips (9)
  • JQuery (2)
  • Magento (28)
    • Magento 2 (4)
  • mySQL (8)
  • PHP (13)
  • SEO (6)
  • Server (11)
  • SSH (14)
  • Tools (5)
    • Sublime Text (1)
  • Uncategorized (2)

Archives

  • September 2019
  • July 2019
  • June 2019
  • May 2019
  • January 2019
  • September 2018
  • May 2018
  • January 2018
  • November 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • October 2016
  • September 2016
  • July 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • June 2015

Month: May 2017

PHP: Rounding Numbers to the Nearest 5,10,12 or X

Here is a little helper function in PHP to round an integer number to the nearest X, where X can be any other integer number.  You can specify to force to round up, round down or whichever is closest (round up if it is the same in either direction).

Continue reading PHP: Rounding Numbers to the Nearest 5,10,12 or X

Posted on 2017-05-082017-05-08Categories PHPLeave a comment on PHP: Rounding Numbers to the Nearest 5,10,12 or X
Proudly powered by WordPress
This website uses cookies to improve your experience and so I can see what articles you like best. I assume you're ok with this, but you can opt-out if you wish.Accept Read More
Privacy & Cookies Policy