For a program I'm writing I only need two digits past the decimal.I was a c programmer and the way I would have done this was

printf("%2f",variable);

Is there anything like this in cout?

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.