* precision as x.
     */
    public static BigDecimal ceilingSignificantDigit(
            BigDecimal x) {
        // Deal with special cases
        if (x.compareTo(BigDecimal.ZERO) == -1) {
            BigDecimal result;
            result = ceilingSignificantDigit(x.negate());
            //result = floorSignificantDigit(x.negate());
            return result.negate();
        }
        if (x.compareTo(BigDecimal.ZERO) == 0) {
            return BigDecimal.ZERO;
        }
        BigDecimal result;
        BigInteger xUnscaledValue = x.unscaledValue();
        String xUnscaledValueString = xUnscaledValue.toString();
        int scale = x.scale() - xUnscaledValueString.length() + 1;
        int biggest = new Integer(xUnscaledValueString.substring(0, 1));
        biggest++;
        result = new BigDecimal(BigInteger.valueOf(biggest), scale);
        return result.stripTrailingZeros();
    }