How to set decimal precision...

This is a discussion on How to set decimal precision... within the C++ Programming forums, part of the General Programming Boards category; Is there an _easy_ way (i.e. a C++ function or operator) to set the precision to the right of the ...

Quick follow-up to Mr. C's post, make certain to include the 'fixed' manipulator as he has. The standard display precision is six places - as I recall - but includes the value's mantissa in the count. That is, 123.45678 displays as 123.457 (note the rounding of the value).

By using 'fixed', the argument supplied with setprecison() determines the number of places following the decimal.