guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Formatted output with locale


From: dev
Subject: Formatted output with locale
Date: Sun, 13 Nov 2016 17:56:38 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]