code: function sigFigs(n, sig) {
        const mult = Math.pow(10,
            sig - Math.floor(Math.log(n) / Math.LN10) - 1);
        return Math.round(n * mult) / mult;
      }
docs: http://blog.magnetiq.com/post/497605344/rounding-to-a-certain-significant-figures-in