Hi All,
I am fairly new to Lisp, so forgive me if this is too simple.
I am trying to write a small library to do data joining and plotting in
Common Lisp, using all the good things from other plotting programs i've
used and excluding the bad things.
There is a good idea from a program called SAS that i would like to
borrow. I would like to print an object in a format similar to SAS's
"bestN", where N is some number of digits.
So for example, you could format an object to best9, and it would print
the object in the "best" 9 characters possible. So if it is a small
integer, it just prints it with padding. If it's a float with alot of
significant digits, it rounds it. If it's a very large or very small
number, it puts it in exponential notation, and if it's a string less
than 9 characters, it prints it, else use an overflow character 9 times.
In all cases, you're guaranteed to have exactly than 9 (or N)
characters. It is a lot like the ~nA format directive, except ~nA
guarantees only a minimum, and not a maximum number of characters.
Perhaps this format directive is already available within Common Lisp.
Any ideas would be appreciated.
Thanks,
Steve Eichblatt