GnuCash XML sched-xaction split amount formatting

Phil Longstaff phil.longstaff at gmail.com
Wed Apr 29 10:36:53 EDT 2015


I can add a scheduled transaction for the purchase of a number of shares of
a stock or mutual fund, and this number of shares could have more or fewer
than 2 decimal places.

On Wed, Apr 29, 2015 at 9:03 AM, Ngewi Fet <ngewif at gmail.com> wrote:

> Hi Geert,
> Thanks for that info. That puts us in a tight spot. Now GncA could either:
> - skip scheduled transactions completely (not desirable)
> - parse the wrong amount and let the user edit it later (I am less inclined
> to do this) or
> - fail the import completely (which is what happens now and will make the
> import feature less-than-useful for many) .
>
> One solution that comes to mind though, if I could reliably know how many
> decimal places are included in the amount, then I can parse it irrespective
> of the separator.
> Does GnuCash always use 2 decimal places, or does this depend on the
> currency, or something else?
>
> But then that also leaves the issue of GnuCash choking on XML files
> exported by GncA because we cannot predict what locale the user will be
> using.
> Best guess will be to use the mobile device locale and hope that the user
> has the same setting on the desktop!
>
> Regards,
> Ngewi F.
>
> On Wed, Apr 29, 2015 at 12:42 PM, Geert Janssens <
> geert.gnucash at kobaltwit.be
> > wrote:
>
> >  On Wednesday 29 April 2015 11:35:42 Ngewi Fet wrote:
> >
> > > Hello,
> >
> > > In GnuCash XML, scheduled transaction splits do not have the
> >
> > > <split:value/> and <split:quantities/> set. Rather the amount is
> >
> > > stored as a slot with key <sched-xaction>.
> >
> > >
> >
> > > I would like to know if the formatting of this amount is (device or
> >
> > > gnucash) locale-specific, or uniform across all GnuCash instances.
> >
> > >
> >
> > > For me, it is formatted as , e.g. 200,00 or 2.500,00
> >
> > > Note the comma for decimal separator and period for thousands
> >
> > > separator (which would be correct for my device locale but incorrect
> >
> > > for my GnuCash locale which is en_US).
> >
> > > The formatting doesn't seem to change when I modify the GnuCash
> >
> > > locale.
> >
> > >
> >
> > > Can anyone shed some light on the formatting of the split amounts of
> >
> > > scheduled transactions?
> >
> > > It would help when parsing GnuCash XML files in GnuCash Android.
> >
> > > Thanks.
> >
> > >
> >
> > > Regards,
> >
> > > Ngewi F.
> >
> > > _______________________________________________
> >
> > > gnucash-devel mailing list
> >
> > > gnucash-devel at gnucash.org
> >
> > > https://lists.gnucash.org/mailman/listinfo/gnucash-devel
> >
> >
> >
> > Hi Ngewi,
> >
> >
> >
> > Unfortunately you hit one of GnuCash's dark corners here. The SX amount
> > formula is stored in gnucash in the locale that is active at that time.
> > This has been a poor design decision (more like on oversight probably) at
> > the time.
> >
> >
> >
> > It gets worse if you change locales afterwards because gnucash doesn't
> > store the locale information itself with the formula and hence can't
> > convert the stored formulas to the new locale, resulting in errors when
> > these formulas have to be parsed.
> >
> >
> >
> > This has been reported as a bug [1] which hasn't been fixed yet so far.
> >
> >
> >
> > I'm not sure what you can do on the gnucash-on-android side to properly
> > handle this if gnucash itself even doesn't.
> >
> >
> >
> > Geert
> >
> >
> >
> > [1] https://bugzilla.gnome.org/show_bug.cgi?id=370331
> >
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>


More information about the gnucash-devel mailing list