unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Formatted output with locale
@ 2016-11-13 16:56 dev
       [not found] ` <CAMvDHVA+TcZg-ak_Nt6vGQW5w4B4KSmEPd3uEziJ0EDXbPp54A@mail.gmail.com>
  2016-11-17 11:02 ` Ludovic Courtès
  0 siblings, 2 replies; 7+ messages in thread
From: dev @ 2016-11-13 16:56 UTC (permalink / raw)
  To: guile-user

Hi there,
I have problems to get a proper formatting using the (ice-9 format)
module. In my code, I need to deal with monetary figures, but I fail
to get the correct format for my German locale.
Let's say I have one hundred thousand Euros. The correct format to output
this in de_DE.utf-8 would be
100.000,00 EUR
(with 2 decimals)

Now I tried:
(setlocale LC_ALL "de_DE.UTF-8")
(use-modules (ice-9 format))
(define a 100000.00)
(format #t "~12,2h EUR~%" a)
(format #t "~,,12$ EUR~%" a)
(format #t "~12,2f EUR~%" a)

But this is what Guile gives to me:
   100.000,0 EUR
   100000.00 EUR
   100000.00 EUR

None is correct. What did I miss? 
-Martin




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-11-23 12:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-13 16:56 Formatted output with locale dev
     [not found] ` <CAMvDHVA+TcZg-ak_Nt6vGQW5w4B4KSmEPd3uEziJ0EDXbPp54A@mail.gmail.com>
2016-11-14  6:06   ` Fwd: " Vladimir Zhbanov
2016-11-17 11:02 ` Ludovic Courtès
2016-11-17 16:07   ` Eli Zaretskii
2016-11-17 16:53   ` Vladimir Zhbanov
2016-11-21  9:31     ` Ludovic Courtès
2016-11-23 12:06       ` Vladimir Zhbanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).