I'm not sure how to go about lining this up better. I thought by using L = name.length();
and subtracting that from the setw
it would line up better but nope. I have name
and ID
set correctly but I can't seem to get the rest to line up. These are floats
btw.
for (int z=0; z<i ;z++){
if( EInfo[z].valid >0){
string name = employee[z].getName();
int L = name.length();
payReportObj << fixed << setprecision (2) << endl;
payReportObj << setw(3) << employee[z].getID()
<< setw(36)
<< employee[z].getName()
<< setw(30-L) << "$" << setw(4) << EInfo[z].grossPaySE
<< setw(25) << "$" << setw(4) << EInfo[z].taxSE
<< setw(15) << "$" << setw(4) << EInfo[z].insuranceSE
<< setw(25) << "$" << setw(4) << EInfo[z].netPaySE;
I'm attempting to get it more like this...
This is what I have...