GNOME Bugzilla – Bug 787572
Currency symbol in the middle of number
Last modified: 2018-06-29 23:59:28 UTC
Created attachment 359572 [details] Currency symbol is showing inside the number Hello, In reports the currency symbol shows up in the middle of number. I attach a sample balance sheet report.
Cool. Looks like another currency showing bug 787749 too. What currency is it? I'm not able to replicate the problem with USD and when I try with IRR no currency symbol shows up on the report.
Currently I am using GnuCash in Manjaro. Previously I used it in Ubuntu and it was the same. Possibly has to do with environment regional settings. I might have somewhere hinted that I am living in Iran and the system has set some adjustments. Any information I can post?
Yeah, what font are you using? I can't find one in Debian that will render the rial codepoint (u+fdfc).
I am using system fonts.
It might vary with distribution, desktop environment, ... Perhaps https://wiki.gnucash.org/wiki/FAQ#Q:_How_get_I_rid_of_strange_unreadable_characters_or_adjust_the_font_size can help you to get it's name?
I've managed to reproduce it, having finally found a farsi font that displays the rial symbol. One must set "Region and Formats" to Iran in System Preferences>Language and Region. As Hamid noted it only affects reports. I haven't yet figured out whether it's WebKit's fault or something we're doing.
Hamid, what are your locale settings?
LANG=en_US.utf8 LC_CTYPE="en_US.utf8" LC_NUMERIC=fa_IR LC_TIME=fa_IR LC_COLLATE="en_US.utf8" LC_MONETARY=fa_IR LC_MESSAGES="en_US.utf8" LC_PAPER=fa_IR LC_NAME=fa_IR LC_ADDRESS=fa_IR LC_TELEPHONE=fa_IR LC_MEASUREMENT=fa_IR LC_IDENTIFICATION=fa_IR LC_ALL=
Hmm. As an exercise can you try running with LC_ALL=fa_IR.utf8? The simplest way is to start it from a terminal: LC_ALL=fa_IR.utf8 Frank's and my testing shows that this will still put the Rial symbol to the right of the left-most grouping. I want to make sure that's the case on your system as well. When writing numbers in Farsi is it normal for the numbers to go left-to-right even though surrounding text is right-to-left?
LC_ALL=fa_IR.utf8 made no difference. Persian text is a combination of RTL alpha and LTR numeric sequence of alphanumeric characters. In other words text direction naturally changes when numbers are involved but we consider the total text as RTL. As far as I know there are extra Unicode characters to mark portions of RTL and LTR words when combining numerical and non-numerical content in a word. Just some information if relevant: https://bugreports.qt.io/browse/QTBUG-58364 Special Non-Printing input characters are being rejected by Qt's text engine
Interesting, thanks. And do you normally put the currency symbol on the right or left?
We put the currency symbol to the left of the number.
I am wondering, we do not see this behavior when opening the file e.g. with LANG=ar_BH.utf8 or he_IL.utf8. Before I set both currencies to IRR to avoid the conversion to their currencies. https://opensource.com/life/16/3/twisted-road-right-left-language-support shows in the sections 'Two languages together, Kumbaya' ff. what can happen mixing strong, weak and neutral types of LTR and RTL text. We have a currency symbol (strong RTL) and a number (weak LTR). I think, it is somehow related to "٬" as thousand delimiter. The other tested languages use normal commas. Probaly it is a stronger LTR or breaks in some other way the direction. Re #c12: So, in RTL reading, it means behind the number? Then the Zero values are wrong formated, too.
About zero values and formatting, correct. But sometimes in tabular style, currency symbols are aligned in a way to make it look nice or are factored in the column headings. Depends on how you formatted the mainstream currencies.
Created attachment 360289 [details] Balance sheet exported as HTML.
Created attachment 360290 [details] Screenshot of balancesheet.html rendered in Chrome.
Created attachment 360291 [details] balancesheet.html rendered in Firefox.
It occurred to me that this might be a WebKit problem rather than a GnuCash one, so I exported the report in HTML and displayed it in Chrome (which uses the WebKit rendering engine) and Firefox (which doesn't). The results are attached and one can clearly see that Chrome does it wrong but Firefox does it right. I've filed https://bugs.webkit.org/show_bug.cgi?id=177384 for you.
Created attachment 360295 [details] KDE system panel showing mix of different number shapes The time is 0:44 which is showing in Persian shape. Other numbers are showing in Western shape.
There is a catch: we are mixing locale details and it might not produce expected results. Numbers are in Latin script (0,1,2 ...) but the currency symbol is Persian. I have found that KDE provides better internationalization since sometimes even the time is output in Persian digits (the attachment for comment 19). Another example is Libreoffice which independent of system has an option to show digits in different forms (Arabic, Hindi - I know, the names are misleading). Is it possible to add such capabilities to GnuCash?
(In reply to Hamid from comment #19) > Created attachment 360295 [details] > KDE system panel showing mix of different number shapes > > The time is 0:44 which is showing in Persian shape. Other numbers are > showing in Western shape. What does that have to do with GnuCash?
(In reply to Hamid from comment #20) > There is a catch: we are mixing locale details and it might not produce > expected results. Numbers are in Latin script (0,1,2 ...) but the currency > symbol is Persian. I have found that KDE provides better > internationalization since sometimes even the time is output in Persian > digits (the attachment for comment 19). Another example is Libreoffice which > independent of system has an option to show digits in different forms > (Arabic, Hindi - I know, the names are misleading). Is it possible to add > such capabilities to GnuCash? Maybe someday. I'm pretty sure that would require that we switch to ICU for numeric formatting, which would be a bit of work and there's plenty ahead of it in the queue and very few developers.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=787572. Please update any external references or bookmarks.