Software Development Round number to nearest multiple October 10, 2018 Torleif Leave a comment const roundToNearest = (i, n) => i%n > n/2 ? i + n - i%n : i - i%n; Source: gist.github.com/aslakhellesoy