Fw: [plt-scheme] Printing

From: jos koot (jos.koot at tiscali.nl)
Date: Fri Oct 21 08:46:02 EDT 2005

From: "jos koot" <jos.koot at tiscali.nl>
To: "Evan Farrer" <farrer at cs.utah.edu>
Sent: Friday, October 21, 2005 2:44 PM
Subject: Re: [plt-scheme] Printing


 See http://home.tiscali.nl/can_jos/format.scm  and 
 http://home.tiscali.nl/can_jos/format docs.scm for a simple fortran-like 
 formatting tool including a format called f for reals.
 
 ((((lambda(x)((((((x x)x)x)x)x)x))
   (lambda(x)(lambda(y)(x(x y)))))
  (lambda(x)(write x)x))
 "greetings, Jos")
 
 ----- Original Message ----- 
 From: "Evan Farrer" <farrer at cs.utah.edu>
 To: <plt-scheme at list.cs.brown.edu>
 Sent: Saturday, October 15, 2005 5:59 AM
 Subject: [plt-scheme] Printing
 
 
> This is a really simple question, but I can't find the answer anywhere 
> (help-desk, google, etc.).  How do you control, how many decimal places 
> get printed with a floating pointer number.
>
> For example I want somthing like:
>
> (define PI 3.1479)
>
> (printf "~1.2a\n" PI) => 3.14
>
> or
>
> (printf "~a\n" (decimal-places PI 2)) => 3.14
>
>
> Thanks,
>
> Evan
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme 



Posted on the users mailing list.