unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#45871: Incorrect currency symbol used by locale support
@ 2021-01-14 19:19 Guenther Brunthaler
  0 siblings, 0 replies; only message in thread
From: Guenther Brunthaler @ 2021-01-14 19:19 UTC (permalink / raw)
  To: 45871

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.





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-14 19:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14 19:19 bug#45871: Incorrect currency symbol used by locale support Guenther Brunthaler

unofficial mirror of bug-guile@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guile-bugs/0 guile-bugs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guile-bugs guile-bugs/ https://yhetil.org/guile-bugs \
		bug-guile@gnu.org
	public-inbox-index guile-bugs

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.lisp.guile.bugs
	nntp://news.gmane.io/gmane.lisp.guile.bugs


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git