Newb has output formatting question

  • Thread starter Thread starter menotu3169
  • Start date Start date
M

menotu3169

Alright, I'm just learning C++ and I'm trying to make a program.
It uses a 10*10 array, calculates what all the values are and then
outputs the values stored in the array on the screen.

My teacher's out sick, and no one in my class has been able to help
me.


What I want to do, is take an array of double values, and output them
on the screen in a nice looking format.

All I really need is a way to output a different number of spaces,
depending on the number of decimal places in the number.

I've tried using strlen(), but that doesn't work, as it's an array of
numbers.

Any help would be greatly appreciated.
And can you try to keep answers simple, I am just learning this stuff.
 
int Digits_in_Double( double value )
{
return value.ToString()->Length ;
}

The number of digits includes decimal point and negative sign if negative.
It also assumes base 10 math... : )

[==P==]

int number_of_digits_in double =
 
Back
Top