Formatting output to table

Thanks in advance.

How would I present the output of 2 variables (double) as a fixed width, 2-column table? As well, the right most column has decimal points of data aligned.


Here is my function that converts input to desired result with some ad hock formatting that is my attempt to make a pseudo table. It does not work poperly :(




void FtoC(double lo,double hi, double gap) //convert farenheit to celcius
{
vartemp = (5*(lo-32))/(9);
cout << "| " << setprecision(2) << lo << " | " << setprecision(2) << vartemp << " |" << endl;
}



Cheers
Topic archived. No new replies allowed.