setprecision

Syntax

SMANIP( int ) setprecision( int np );

#include <iomanip.h>

Parameters

np

An integer that indicates the number of significant digits or significant decimal digits to be used for floating-point display.

Remarks

This parameterized manipulator sets the stream's internal floating-point precision variable to np. The default precision is six digits. If the display format is scientific or fixed, then the precision indicates the number of digits after the decimal point. If the format is automatic (neither floating point nor fixed), then the precision indicates the total number of significant digits.

This setting remains in effect until the next change.