Since we're talking about number formatting

"Tim Bradshaw (as tfb at tfeb dot org)" <[email protected]> Wed, 29 Apr 2026 11:41:30 +0100
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
I want to print a bunch of stuff to 2 significant figures (more generally to any fixed number of them).

So I want

0 -> 0.00  and not 0 or 0.0
1.1 -> 1.10 and not 1.1
9 -> 9.00 same rules
10 -> 10.0
100 -> 100 (no point)
999 -> 999
1000 -> 1.00e3

Is there any standard format incantation which does this?

In fact I already have to deal with the large-magnitude case as what I actually want is 1.00\times 10^{3} for instance so it's only the small-magnitude case I need to deal with.

--tim

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html