[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme coding] turning a list into a markup/string
From: |
Kieren MacMillan |
Subject: |
Re: [Scheme coding] turning a list into a markup/string |
Date: |
Wed, 22 Jan 2020 07:28:06 -0500 |
Hi Aaron,
> Instead of string-append and number->string, try (format #f "~@d" d).
>
> ~d formats an integer as a decimal value
> @ includes "+" for positive values
>
> One caveat is it formats zero as "+0".
>
> Perhaps: (lambda (d) (if (zero? d) "0" (format #f "~@d" d)))
That’s great — thanks!
Kieren.
________________________________
Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: address@hidden
- Re: [Scheme coding] turning a list into a markup/string, (continued)
- Re: [Scheme coding] turning a list into a markup/string, David Kastrup, 2020/01/21
- Re: [Scheme coding] turning a list into a markup/string, Kieren MacMillan, 2020/01/21
- Re: [Scheme coding] turning a list into a markup/string, David Kastrup, 2020/01/21
- Re: [Scheme coding] turning a list into a markup/string, Kieren MacMillan, 2020/01/21
- Re: [Scheme coding] turning a list into a markup/string, David Kastrup, 2020/01/21
- Re: [Scheme coding] turning a list into a markup/string, Kieren MacMillan, 2020/01/21
- Re: [Scheme coding] turning a list into a markup/string, David Kastrup, 2020/01/21
Re: [Scheme coding] turning a list into a markup/string, Kieren MacMillan, 2020/01/21
Re: [Scheme coding] turning a list into a markup/string, Urs Liska, 2020/01/22