double doubleValue = ( (Double) source ).doubleValue( ); return new BigDecimal( doubleValue );
Double d2 = (Double) source; if ( d2.isNaN( ) || d2.isInfinite( ) ) { throw new BirtException( pluginId, ResourceConstants.CONVERT_FAILS, new Object[]{ d2.isNaN( ) ? "NaN" : "infinite value", "BigDecimal" }, resourceBundle ); } return new BigDecimal( d2.doubleValue( ) );
	public static BigDecimal toBigDecimal( Object source ) throws BirtException	{		if ( source == null )			return null;				if ( source instanceof Integer )		{			String str = ( (Integer) source ).toString( );			return new BigDecimal( str );		}		else if ( source instanceof BigDecimal )		{			return (BigDecimal) source;		}		else if ( source instanceof Boolean )		{			if ( true == ( (Boolean) source ).booleanValue( ) )				return new BigDecimal( 1d );			return new BigDecimal( 0d );		}		else if ( source instanceof Date )		{			long longValue = ( (Date) source ).getTime( );			return new BigDecimal( longValue );		}		else if ( source instanceof Double )		{			double doubleValue = ( (Double) source ).doubleValue( );			return new BigDecimal( doubleValue );		}		else if ( source instanceof String )		{			try			{				return new BigDecimal( (String) source );			}			catch ( NumberFormatException e )			{				throw new BirtException( pluginId,						ResourceConstants.CONVERT_FAILS,						new Object[]{								source.toString( ), "BigDecimal"						},						resourceBundle );			}		}		else		{			throw new BirtException( pluginId,					ResourceConstants.CONVERT_FAILS,					new Object[]{							source.toString( ), "BigDecimal"					},					resourceBundle );		}	}