Calculation for NetProfit Function