From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: dev@famic.de Newsgroups: gmane.lisp.guile.user Subject: Formatted output with locale Date: Sun, 13 Nov 2016 17:56:38 +0100 Message-ID: <20161113165638.GA23086@remote.famic.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1479057925 20696 195.159.176.226 (13 Nov 2016 17:25:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 13 Nov 2016 17:25:25 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Nov 13 18:25:21 2016 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5yWh-0003Mf-PL for guile-user@m.gmane.org; Sun, 13 Nov 2016 18:25:07 +0100 Original-Received: from localhost ([::1]:34550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5yWl-0007bt-13 for guile-user@m.gmane.org; Sun, 13 Nov 2016 12:25:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5y5r-00078r-1F for guile-user@gnu.org; Sun, 13 Nov 2016 11:57:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c5y5m-0004nX-6M for guile-user@gnu.org; Sun, 13 Nov 2016 11:57:23 -0500 Original-Received: from euve32322.vserver.de ([85.25.48.132]:36717 helo=famic.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5y5m-0004nQ-0K for guile-user@gnu.org; Sun, 13 Nov 2016 11:57:18 -0500 Original-Received: from remote.famic.de (ipbcc20513.dynamic.kabel-deutschland.de [188.194.5.19]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by famic.de (Postfix) with ESMTPSA id A5ABE2E09A7 for ; Sun, 13 Nov 2016 17:56:44 +0100 (CET) Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 85.25.48.132 X-Mailman-Approved-At: Sun, 13 Nov 2016 12:24:44 -0500 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:12986 Archived-At: 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