function ret=monthlyint( P, M,a=0,r)
  %% P = Principal
  %% r = interest rate (as a decimal)
  %% t = time in years
  ret=0;
  r/=100;
  for i=1:M    
    m=interest( P, r, 1/12 );
    ret+=m;
    printf( "Mth: %i\tAmt: $%4.2f\tInt: %4.2f\tRate:%4.2f\n",i,P,m,r*100 );
    P+=m;
    P+=a;
  endfor
  
endfunction
