protected static Ptg calcDB( Ptg[] operands )
	{
		if( (operands.length < 4) || (operands[0].getComponents() != null) )
		{ // not
			// supported
			// by
			// function
			PtgErr perr = new PtgErr( PtgErr.ERROR_NULL );
			return perr;
		}
		double cost;
		double salvage;
		int life;
		int period;
		int month;
		cost = new Double( String.valueOf( operands[0].getValue() ) );
		salvage = new Double( String.valueOf( operands[1].getValue() ) );
		life = Integer.valueOf( String.valueOf( operands[2].getValue() ) );
		period = Integer.valueOf( String.valueOf( operands[3].getValue() ) );
		if( operands.length > 4 )
		{
			if( operands[4] instanceof PtgMissArg )
			{
				month = 12;
			}
			else
			{
				month = Integer.valueOf( String.valueOf( operands[4].getValue() ) );
			}
		}
		else
		{
			month = 12;
		}
		double salCost = salvage / cost;
		// this section longhand due to some wierd calcs when calling lifdiv =
		// 1/life;
		double lifdiv = 1;
		lifdiv /= life;
		double rate = Math.pow( salCost, lifdiv );
		rate = 1 - rate;
		rate = rate * 1000;
		rate = Math.round( rate );
		rate /= 1000;

		double totalDepreciation = (cost * rate * month) / 12;
		double result = totalDepreciation;
		// 1st and last (i.e. period==life) are special cases 
		for( int i = 2; (i < period) || ((i == period) && (period <= life)); i++ )
		{
			result = (cost - totalDepreciation) * rate;
			totalDepreciation += (cost - totalDepreciation) * rate;
		}
		if( period > life )    // last depreciation is special calc
		{
			result = (cost - totalDepreciation) * rate * (12 - month) / 12;
		}
		PtgNumber pnum = new PtgNumber( result );
		return pnum;
	}