for (int i = 1; i <= 36; i++)
{
L;
payment = ((Rate * pow(1 + Rate, N)) / (pow(1 + Rate, N) - 1)) * L;
N--;
interest = L * Rate;
principal = payment - interest;
L -= principal;
if (i < 10)
cout << fixed <<setprecision(2)
<< "Month" <<" "<<i<<" $"<<payment<<" $"<<principal<<" $"<<interest<<" $"<<L<<"\n";
else
cout<< fixed <<setprecision(2)
<< "Month" <<" "<<i<<" $"<<payment<<" $"<<principal<<" $"<<interest<<" $"<<L<<"\n";
}
}
I know the output will have horrible spacing, but I just want to know how to align my decimals. Thank you.