need 4 items to format a number - format (fixed/scientific/general) - width - precision - left/right (default is right, but suppose had used 'left' earlier for a string) fixed, scientific, general: (see precision2.cpp) - fixed = business format (fixed no. of decimal places) - scientific = scientific notation (mantissa/exponent) - general = fixed for small nos., scientific for large - default is general - fixed and scientific reset each other - to return to general, resetiosflags(ios::fixed | ios::scientific) or cout.unsetf(ios::fixed | ios::scientific) setw(): (see width2.cpp) - only manipulator that is not sticky/persistent - default is setw(0) = no spaces between numbers - if number is too large, it forces columns to move over precision(): (see point1.txt and justify5.cpp) - fixed: no. of decimal places - scientific: no. of decimal places in mantissa - general: total no. of digits (on this compiler) - default is setprecision(6) (see precision2.cpp) left and right: (see justify5.cpp) - left and right reset each other (also internal, see below) - default is right - usually want 'left' for strings, then need 'right' for following number setfill: (see manip1.cpp) - setfill('*') for checks - setfill('0') for ID nos. - setfill('0') for hex (see below) - default is setfill(' ') - setfill doesn't work with negative numbers (not intended for that) unless internal justification is used (see below) showpoint: (see point1.txt) - only affects general format: forces decimal point, and precision as above - also affects fixed when precision=0: forces decimal point (see mods2.cpp) - default is noshowpoint showpos: (see manip1.txt) - forces '+' - default is noshowpos internal justification: (see manip2.txt) - forces sign in separate column on the left - left, right, and internal reset each other dec, hex, showbase: (see mods2.cpp) - hex = show number in hex - showbase = puts 0x before hex number - may also need setfill('0') to get full 8-digit hex boolalpha: (see bool6.cpp) - display true and false instead of 1 and 0 what needs to be included: - all need #include - manipulators with arguments need