guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: number formatting lib.


From: Alex Shinn
Subject: Re: number formatting lib.
Date: 21 Aug 2001 13:02:58 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.104

>>>>> "Stan" == Stan Pinte <address@hidden> writes:

    Stan> I am looking for number-formatting fonctions in guile...

    Stan> of the style (number-format "#.##$" mynumber) which would
    Stan> return a string.

You want the (ice-9 format) module.  The general rule of thumb (coming
from C style printf) is that we use '~' instead of '%' and ',' instead
of '.'.  So you might do:

  (format #f "~4,2F" number)

There are some more examples of this in the PLEAC Guile cookbook
mentioned recently:

http://pleac.sourceforge.net/pleac_guile/t1.html

-- 
Alex Shinn <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]