home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 17897 < prev    next >
Encoding:
Text File  |  1992-12-13  |  1.9 KB  |  50 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!cs.utexas.edu!torn!news.ccs.queensu.ca!qucis.queensu.ca!kirkwood
  3. From: kirkwood@qucis.queensu.ca (Scott Kirkwood)
  4. Subject: C++ classes submitted to comp.sources.misc.
  5. Message-ID: <1992Dec13.231515.15658@qucis.queensu.ca>
  6. Organization: Computing & Information Science, Queen's University at Kingston
  7. Date: Sun, 13 Dec 1992 23:15:15 GMT
  8. Lines: 40
  9.  
  10. Since we don't have a comp.source.c++ group, I thought you would like
  11. to know that I submitted three classes to comp.sources.misc:
  12.     IFormat   fast integer number formatter,
  13.     FFormat   floating point number formatter,
  14.     TFormat   template version of FFormat. (included with fformat)
  15.  
  16. IFormat was designed to be fast and was originally designed to be used
  17. in a program that lists directories with their file sizes.  FFormat is
  18. far from fast, but is more powerful and extendible.  All of these
  19. programs will format the number so that it fits a certain specified
  20. width.  If the number doesn't fit, the program will attempt to use SI
  21. postfix notation to make it fit.
  22.  
  23. For example,
  24.   IFormat
  25.     12345678  -> 12,345,678    (/any/ width)
  26.     12345678  -> 12,345K       (width set to 7)
  27.   FFormat
  28.     1234.56789012 -> 1,234.5678 9012 
  29.     1234.56789012 -> 1,234.6   (width set to 7)
  30.     1234.56789012 -> 1K        (width set to 2)
  31.   TFormat<Integer>  
  32.      // using g++'s arbitrary size Integer class 
  33.     123456789012345678901 -> 123,456,789,012,345,678,901
  34.  
  35. These are not programs, but classes and are not useful by themselves.
  36. One day I hope that there will be many (free) classes that can be
  37. re-used by everyone.
  38.  
  39. I'd appreciate any comments you have.
  40.  
  41. -------------------- kirkwood@qucis.queensu.ca ----------------------
  42.       299,792,458 m/s it's not just a good idea, it's the law!
  43.  
  44.  
  45.  
  46. -- 
  47. -------------------- kirkwood@qucis.queensu.ca ----------------------
  48.       299,792,458 m/s it's not just a good idea, it's the law!
  49.  
  50.