Package java.math

Examples of java.math.BigDecimal.toPlainString()


        || hfsType == HCatFieldSchema.Type.VARCHAR
        || hfsType == HCatFieldSchema.Type.CHAR) {
      BigDecimal bd = (BigDecimal) val;
      String bdStr = null;
      if (bigDecimalFormatString) {
        bdStr = bd.toPlainString();
      } else {
        bdStr = bd.toString();
      }
      if (hfsType == HCatFieldSchema.Type.VARCHAR) {
        VarcharTypeInfo vti = (VarcharTypeInfo) hfs.getTypeInfo();
View Full Code Here


        } else if (object instanceof Byte) {
            d = new BigDecimal(((Number)object).byteValue());
        } else {
            d = new BigDecimal(((Number)object).doubleValue());
        }
        writer.writeValue(d.toPlainString());
    }
}
View Full Code Here

    }

    //Convert a Generic Numeric (BigDecimal) value to a String
    private String convertNumericValueToString( DTCellValue52 dcv ) {
        final BigDecimal value = (BigDecimal) dcv.getNumericValue();
        return ( value == null ? "" : value.toPlainString() );
    }

    //Convert a BigDecimal value to a String
    private String convertBigDecimalValueToString( DTCellValue52 dcv ) {
        final BigDecimal value = (BigDecimal) dcv.getNumericValue();
View Full Code Here

    }

    //Convert a BigDecimal value to a String
    private String convertBigDecimalValueToString( DTCellValue52 dcv ) {
        final BigDecimal value = (BigDecimal) dcv.getNumericValue();
        return ( value == null ? "" : value.toPlainString() );
    }

    //Convert a BigInteger value to a String
    private String convertBigIntegerValueToString( DTCellValue52 dcv ) {
        final BigInteger value = (BigInteger) dcv.getNumericValue();
View Full Code Here

            case DATE:
                Date dateValue = dcv.getDateValue();
                return ( dateValue == null ? null : format.format( dcv.getDateValue() ) );
            case NUMERIC:
                BigDecimal numericValue = (BigDecimal) dcv.getNumericValue();
                return ( numericValue == null ? null : numericValue.toPlainString() );
            case NUMERIC_BIGDECIMAL:
                BigDecimal bigDecimalValue = (BigDecimal) dcv.getNumericValue();
                return ( bigDecimalValue == null ? null : bigDecimalValue.toPlainString() );
            case NUMERIC_BIGINTEGER:
                BigInteger bigIntegerValue = (BigInteger) dcv.getNumericValue();
View Full Code Here

            case NUMERIC:
                BigDecimal numericValue = (BigDecimal) dcv.getNumericValue();
                return ( numericValue == null ? null : numericValue.toPlainString() );
            case NUMERIC_BIGDECIMAL:
                BigDecimal bigDecimalValue = (BigDecimal) dcv.getNumericValue();
                return ( bigDecimalValue == null ? null : bigDecimalValue.toPlainString() );
            case NUMERIC_BIGINTEGER:
                BigInteger bigIntegerValue = (BigInteger) dcv.getNumericValue();
                return ( bigIntegerValue == null ? null : bigIntegerValue.toString() );
            case NUMERIC_BYTE:
                Byte byteValue = (Byte) dcv.getNumericValue();
View Full Code Here

            switch ( type ) {
                case BOOLEAN:
                    return cv.getBooleanValue().toString();
                case NUMERIC:
                    final BigDecimal numeric = (BigDecimal) cv.getNumericValue();
                    return numeric.toPlainString();
                case NUMERIC_BIGDECIMAL:
                    final BigDecimal numericBigDecimal = (BigDecimal) cv.getNumericValue();
                    return numericBigDecimal.toPlainString();
                case NUMERIC_BIGINTEGER:
                    final BigInteger numericBigInteger = (BigInteger) cv.getNumericValue();
View Full Code Here

                case NUMERIC:
                    final BigDecimal numeric = (BigDecimal) cv.getNumericValue();
                    return numeric.toPlainString();
                case NUMERIC_BIGDECIMAL:
                    final BigDecimal numericBigDecimal = (BigDecimal) cv.getNumericValue();
                    return numericBigDecimal.toPlainString();
                case NUMERIC_BIGINTEGER:
                    final BigInteger numericBigInteger = (BigInteger) cv.getNumericValue();
                    return numericBigInteger.toString();
                case NUMERIC_BYTE:
                    final Byte numericByte = (Byte) cv.getNumericValue();
View Full Code Here

    }

    private AbstractRestrictedEntryTextBox makeNumericTextBox( final DTCellValue52 value ) {
        final AbstractRestrictedEntryTextBox tb = new NumericTextBox( allowEmptyValues );
        final BigDecimal numericValue = (BigDecimal) value.getNumericValue();
        tb.setValue( numericValue == null ? "" : numericValue.toPlainString() );

        // Wire up update handler
        tb.setEnabled( !isReadOnly );
        if ( !isReadOnly ) {
            tb.addValueChangeHandler( new ValueChangeHandler<String>() {
View Full Code Here

    }

    private AbstractRestrictedEntryTextBox makeNumericBigDecimalTextBox( final DTCellValue52 value ) {
        final AbstractRestrictedEntryTextBox tb = new NumericBigDecimalTextBox( allowEmptyValues );
        final BigDecimal numericValue = (BigDecimal) value.getNumericValue();
        tb.setValue( numericValue == null ? "" : numericValue.toPlainString() );

        // Wire up update handler
        tb.setEnabled( !isReadOnly );
        if ( !isReadOnly ) {
            tb.addValueChangeHandler( new ValueChangeHandler<String>() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.