Created attachment 373332 [details] Screenshot of expense view with fractions I created a test project with Mauritanian ouguiya (MRO) as the currency. Usually when I input an amount in the expense field, the figure is either without decimals or with one decimal rounded to the following fifth (35 35.2 35.4 etc.), since one fifth is the smallest coin ever issued for this currency. Now for some reason, whenever I input an amount that ends in a zero with no decimals, such as 30, 500, 2500 etc., the system displays it as "30 + 0/1", i.e. "thirty plus zero parts of one". The fraction is useless and potentially confusing, and I have no idea why it appears only with figures ending in zero. See the attached screenshot where I have typed in 30, 31 and 30.2 on subsequent lines. I'm using GnuCash 3.6, build ID 3.6+(2019-06-29), on 64-bit Windows 8.1.
This goes away with the change in the MRO smallest fraction from 5 to 100. I suspect it's because 1/5 doesn't calculate exactly in binary floating point and because 5 can't be represented as an integer power of 10 it evades the special-casing in the conversion routines.
I'm going to take a look at this.
mmm I can't reproduce the problem. When I leave the account with "Use commodity value", it looks like the smallest fraction is 1/100 so there's no issue. The xml file says parts-per-unit = 5 but smallest fraction 100 This was changed in july 2019, feee495f2 Tue Feb 25 16:39:26 2020 +0100 Geert Janssens Bug 797624 - Wrong Decimal for Vietnam currencies a0a0ffbb7 Thu Jul 25 23:51:50 2019 +0200 Frank H. Ellenberger Bug 797319 - Mauritanian ouguiya MRO shows too few decimals c77607c8c Thu Jul 25 23:33:42 2019 +0200 Frank H. Ellenberger Bug 797316 - New Mauritanian ouguiya MRU not supported ca87572a2 Tue Jul 23 09:42:43 2019 -0700 John Ralls Bug 797319 - Mauritanian ouguiya MRO shows too few decimals So I think this issue should be closed, no? Or should we change the smallest fraction to 1/5 and fix the resulting display bug? Jean
Ah, OK if I change the smallest fraction to 1/5 then I see the problem. I'll try to fix that.
Jean's fix was added to version 3.10, PR #681