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
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
> (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
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
;; 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))