On 3/21/09 1:34 AM, "Mark Polesky" <markpole...@yahoo.com> wrote:
>
>
> \version "2.12.2"
>
> %{
>
> How can I change the following code so that
> it returns "2 0.25 0.3333"? 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\n" a b c))
>
> %{
>
> After some experimenting, I found the
> following solution, but I'd rather not have
> to deal with all the incessant quasiquote
> and unquote stuff. Is there a more elegant
> solution?
>
<snip>
>
> #(let ((a 2.0)
> (b 1/4)
> (c 1/3))
> (my-format #t "~a ~a ~a\n" `(,a ,b ,c)))
>
#(let ((a 2.0)
(b 1/4)
(c 1/3))
(my-format #t "~a ~a ~a\n" (list a b c)))
will work.
Carl
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user