I want to print numbers in the following allignmrnt:

455345

989

456.56

Notice that the decimal point will always be in the same spot no matter how large or small is the number

currently my program prints: 455345

989

456.56

help please!!!!

Printable View

- 10-21-2002Maxdecimal point allignment
I want to print numbers in the following allignmrnt:

455345

989

456.56

Notice that the decimal point will always be in the same spot no matter how large or small is the number

currently my program prints: 455345

989

456.56

help please!!!! - 10-21-2002kuphryn
Do you want to output the decimal points for all values? For example:

1234.45

3333.00

If yes, use std::fixed and std::showpoint.

Otherwise, another solution is an ostringstream. You will have to come up with an algorithm to analyze all situation and add spaces at the end of each string variabl.e

Kuphryn - 10-21-2002Mister C
Look at previous posts (threads) the answer or something similar has allready been answered.