gnc_numeric: fractional displays and rounding
Christian Stimming
stimming at tuhh.de
Sat Jul 26 14:13:21 EDT 2008
Am Samstag, 26. Juli 2008 19:46 schrieb Charles Day:
> > I think changing xaccPrintAmount() the way you described here is a good
> > idea
> > in any case and should be implemented once you have that routine.
>
> A patch for printing is shown below. However, since the new
> convert_to_decimal function may be useful outside of printing, should I
> move it into gnc-numeric.c? And if so, what name would you like?
I'd expect this in gnc-numeric.c with a name like gnc_numeric_to_decimal or
similar (like a class method).
> Do you
> like the style of the parameters? The idea is that you pass in a pointer to
> your gnc_numeric, and convert_to_decimal() returns TRUE if your gnc_numeric
> has been converted. Otherwise FALSE is returned and your gnc_numeric is
> unchanged.
On the first look it looks a bit weird, but on a second thought this is
probably very useful. (This means the documentation should be very clear
here.) Someone who wants a new gnc_numeric returned every time can easily add
that as well as a second function. Looks good to me.
Christian
More information about the gnucash-devel
mailing list