Re: scheme (format) question

2009-03-23 Thread Clinton Ebadi
Mark Polesky writes: >> (define (my-format bool string . list-of-nums) >> (apply format bool string (map set-precision list-of-nums))) >> >> (let ((a 2.0) >> (b 1/4) >> (c 1/3)) >> (my-format #t "~&~a ~a ~a" a b c)) > > > Kjetil, > > Awesome. Thanks. I knew there was something simp

Re: scheme (format) question

2009-03-23 Thread Kjetil S. Matheussen
On Sun, 22 Mar 2009, Mark Polesky wrote: (define (my-format bool string . list-of-nums) (apply format bool string (map set-precision list-of-nums))) (let ((a 2.0) (b 1/4) (c 1/3)) (my-format #t "~&~a ~a ~a" a b c)) Kjetil, Awesome. Thanks. I knew there was something simple

Re: scheme (format) question

2009-03-22 Thread Mark Polesky
> (define (my-format bool string . list-of-nums) > (apply format bool string (map set-precision list-of-nums))) > > (let ((a 2.0) > (b 1/4) > (c 1/3)) > (my-format #t "~&~a ~a ~a" a b c)) Kjetil, Awesome. Thanks. I knew there was something simple, I just couldn't figure it out. T

Re: scheme (format) question

2009-03-22 Thread Kjetil S. Matheussen
Mark Polesky: ;; Hi. ;; ;; How can I change the following code so that ;; it returns "2 0.25 0."? That is: return ;; integers without decimal point, otherwise ;; round to as many decimal places as needed, ;; but not more than 4. (let ((a 2.0) (b 1/4) (c 1/3)) (format #t "~&~a ~a

scheme (format) question

2009-03-21 Thread Mark Polesky
;; Hi. ;; ;; How can I change the following code so that ;; it returns "2 0.25 0."? That is: return ;; integers without decimal point, otherwise ;; round to as many decimal places as needed, ;; but not more than 4. (let ((a 2.0) (b 1/4) (c 1/3)) (format #t "~&~a ~a ~a" a b c))