noshowpoint

Displays only the whole-number part of floating-point numbers whose fractional part is zero.

ios_base& noshowpoint(
   ios_base& _Str
);

Parameters

  • _Str
    A reference to an object of type ios_base, or to a type that inherits from ios_base.

Return Value

A reference to the object from which _Str is derived.

Remarks

noshowpoint is on by default; use showpoint and precision to display zeros after the decimal point.

The manipulator effectively calls _Str.unsetf(ios_base::showpoint), and then returns _Str.

Example

// ios_noshowpoint.cpp
// compile with: /EHsc
#include <iostream>

int main( ) 
{
   using namespace std;
   double f1= 5.000;
   cout << f1 << endl;   // noshowpoint is default
   cout.precision( 4 );
   cout << showpoint << f1 << endl;
   cout << noshowpoint << f1 << endl;
}
5
5.000
5

Requirements

Header: <ios>

Namespace: std

See Also

Reference

iostream Programming

iostreams Conventions

Other Resources

<ios> Members