Hey there, my code is nearly perfect, but I need help with my input for a value. here's the snippet of my code:

cout << setw(15) << right <<"$" ;
            double Amount;
            input >> Amount;
            cout.setf(ios::showpoint);
            cout.setf(ios::fixed);
            cout.precision(2);
            cout.width(8);      
        input.ignore();
        cout << Amount << endl;

i know that input puts a space after itself, and thats throwing off my output, how would i use getline instead of input?

** side note, im doing this on an online compiler, and its difficult to make changes (intellisense doesn't kick in)

Recommended Answers

All 3 Replies

why are you using an online compiler? There are several free compilers that you can download and compile on your computer, assuming you are using your own computer instead of one located in some public place like a library or at school.

I'm at work, andd can't install anything, hence the online compiler; but this can be closed and marked as resolved, I fixed the issue and it works fine :) thanks Dragon

Oh yes, I know how that goes. You can close the thread youself by marking it Solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.