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.
Peter Oliphant - 15 Nov 2005 14:47 GMT
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 =
> 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
[quoted text clipped - 20 lines]
> Posted via http://www.codecomments.com
> ------------------------------------------------------------------------