home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 9.ddi / IOSTRSR1.ZIP / MNSPREC.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1005 b   |  37 lines

  1. /*[]------------------------------------------------------------[]*/
  2. /*|                                                              |*/
  3. /*|     mnsprec.cpp                                              |*/
  4. /*|                                                              |*/
  5. /*|     Predefined manipulators                                  |*/
  6. /*|         smanip_int setprecision( int )                       |*/
  7. /*|                                                              |*/
  8. /*[]------------------------------------------------------------[]*/
  9.  
  10.  
  11. /*
  12.  *      C/C++ Run Time Library - Version 5.0
  13.  *
  14.  *      Copyright (c) 1990, 1992 by Borland International
  15.  *      All Rights Reserved.
  16.  *
  17.  */
  18.  
  19. #include <ioconfig.h>
  20. #include <iostream.h>
  21. #include <iomanip.h>
  22.  
  23. // set the floating-point precision to n digits
  24.  
  25. static ios _FAR & sprec(ios _FAR & i, int n)
  26. {
  27.     i.precision(n);
  28.     return i;
  29. }
  30.  
  31. smanip_int setprecision(int n)
  32. {
  33.     return smanip_int(sprec, n);
  34. }
  35.  
  36.  
  37.