protected static Ptg calcDec2Oct( Ptg[] operands )
	{
		if( operands.length < 1 )
		{
			return new PtgErr( PtgErr.ERROR_NULL );
		}
		debugOperands( operands, "DEC2OCT" );
		long dec = PtgCalculator.getLongValue( operands[0] );
		int places = 0;
		if( operands.length > 1 )
		{
			places = operands[1].getIntVal();
		}
		if( (dec < -536870912L) || (dec > 536870911L) || (places < 0) )
		{
			return new PtgErr( PtgErr.ERROR_NUM );
		}
		String oString = Long.toOctalString( dec );
		if( dec < 0 )
		{    // truncate to 10 digits automatically (should already be two's complement)
			oString = oString.substring( Math.max( oString.length() - 10, 0 ) );
		}
		else if( places > 0 )
		{
			if( oString.length() > places )
			{
				return new PtgErr( PtgErr.ERROR_NUM );
			}
			oString = ("0000000000" + oString);    // maximum= 10 places
			oString = oString.substring( oString.length() - places );

		}
		PtgStr pstr = new PtgStr( oString );
		log.debug( "Result from DEC2OCT= " + pstr.getString() );
		return pstr;
	}