Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!asuvax!noao!stsci!mrose From: mrose@stsci.EDU (Mike Rose) Newsgroups: comp.lang.lisp Subject: How to format to maximize significant figures Message-ID: <1404@stsci.edu> Date: 5 May 90 18:13:32 GMT Organization: Space Telescope Science Institute, Baltimore MD Lines: 22 I'm writing a common lisp routine to print floating point numbers so that the use of available space is maximized. The requirements are: flonums should be printed in fixed-format floating point in a field w characters wide. If the fixed-format representation doesn't fit in w characters, or if exponential floating-point shows more significant figures in w characters, then use exponential floating-point. If the number can't show at least one significant figure in either-fixed format or exponential, use fixed format in as wide a field as necessary. This must be machine-independent. Does anyone have a good way to do this? ~G looked like a good possibility, but it leaves space for the exponent even when one isn't used. Maybe there's something really clever I can do with it? Thanks, Mike Rose mrose@stsci.edu