From: Stefan Nobis
Subject: Format string for decimal point
Date:
Message-ID: <878xdcxag0.fsf@snobis.de>
Hi.
I'm looking for a format string to change the sign for the decimal
point:
(format nil "???" 12.34) ==> 12,34
Is there such a magic option?
--
Stefan.
From: Christian Haselbach
Subject: Re: Format string for decimal point
Date:
Message-ID: <euouto$ic8$1@online.de>
Stefan Nobis wrote:
> I'm looking for a format string to change the sign for the decimal
> point:
>
> (format nil "???" 12.34) ==> 12,34
>
> Is there such a magic option?
I am not sure, but I think there is no such option.
But you may want to have a look at cl-l10n:
http://www.cliki.net/cl-l10n
Regards,
Christian
Stefan Nobis <······@gmx.de> writes:
> I'm looking for a format string to change the sign for the decimal
> point:
>
> (format nil "???" 12.34) ==> 12,34
>
> Is there such a magic option?
Yes: ~/F/
[65]> (format nil "~2,,20,··@/F/" 123456.789)
"**********+123456,79"
[66]> (format nil "~3/F/" 123456.789)
"123456,790"
[67]>
With:
(defun f (output argument colon at &rest parameters)
(princ
(substitute #\, #\.
(format nil
(format nil "~~~{~:[~;~:*~A~]~^,~}~:[~;:~]~:[··@~]$"
(mapcar (lambda (p)
(if (characterp p)
(format nil "'~C" p)
p)) parameters) colon at) argument))
output))
--
__Pascal Bourguignon__
http://www.informatimago.com
http://pjb.ogamita.org
From: Stefan Nobis
Subject: Re: Format string for decimal point
Date:
Message-ID: <874pnz6ulf.fsf@snobis.de>
Pascal Bourguignon <···@informatimago.com> writes:
> Stefan Nobis <······@gmx.de> writes:
>> Is there such a magic option?
> Yes: ~/F/
:)
Thank you very much.
--
Stefan.