unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Guenther Brunthaler <gb_about_gnu@gmx.net>
To: 45871@debbugs.gnu.org
Subject: bug#45871: Incorrect currency symbol used by locale support
Date: Thu, 14 Jan 2021 20:19:54 +0100	[thread overview]
Message-ID: <1e2c4895-6f2c-49a2-82e9-9e2ff08beb14@gmx.net> (raw)

The (locale-currency-symbol) procedure uses the wrong locale setting,
which effects the formatting of monetary amounts:

scheme@(guile-user)> (use-modules (ice-9 i18n))
scheme@(guile-user)> (setlocale LC_ALL "")
$3 = "de_AT.UTF-8"
scheme@(guile-user)> (display (monetary-amount->locale-string +123.456
#f)) (newline)
-€ 123,46

A negative amount???

This seems to be the source of the problem:

scheme@(guile-user)> (locale-currency-symbol #f)
$2 = "-€"

(Note if your e-mail agent cannot display the currency symbol correctly:
The symbol ought to be displayed as the EUR-sign.)

Obviously, the implementation uses the "crncystr" setting:

$ locale -kc LC_MONETARY | grep -E '€'
currency_symbol="€"
crncystr="-€"
duo_currency_symbol="€"

Problem resolution: The implementation should use the "currency_symbol"
setting rather than the "crncystr" setting.

Alternatively, the "crncystr" can be used, but then the first character
should be interpreted as defined by the POSIX standard, i. e. as a mode
indicator and not as part of the actual currency symbol.





                 reply	other threads:[~2021-01-14 19:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1e2c4895-6f2c-49a2-82e9-9e2ff08beb14@gmx.net \
    --to=gb_about_gnu@gmx.net \
    --cc=45871@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).