code: public static Number roundToSignificantFigures(Number num, int precision)
      {
          return new BigDecimal(num.doubleValue())
                  .round(new MathContext(precision, RoundingMode.HALF_EVEN));
      }
docs: <p>
  Rounds a number to significant figures.
  </p>
  
  @param num
  The number to be rounded
  @param precision
  The number of significant digits
  @return The number rounded to significant figures