DxaccPrintAmount returns always absolute value?

Dave Peticolas dave@krondo.com
Thu, 07 Dec 2000 00:15:33 -0800


Christian Stimming writes:
> Hi,
> 
> I recently discovered that all amounts in, say, the Profit and Loss Report 
> are positive. Somehow all minus signs disappeared... and this happens in 
> the function 
> 
>   DxaccPrintAmount (double dval, GNCPrintAmountInfo info)
> 
> by calling
> 
>   val = double_to_gnc_numeric (ABS (dval), 10000, GNC_RND_ROUND);
> 
> Is it intentional that there will be no negative amounts printed? The 
> respective scheme function, gnc:amount->string-helper, is nothing more 
> than a wrapper for DxaccPrintAmount right now, so one of these two 
> funtions should probably be changed. 
> 
> It seems that the absolute value in DxaccPrintAmount was checked in CVS 
> with the following log entry:
> revision 1.6 
> date: 2000/11/08 10:53:35;  author: peticolas;  state: Exp;  lines: +44 -74
> More numerics conversions.
> 
> So, Dave, how do we get the negative amounts into the reports?

Well, first we fix that bug :)

It should work now. Note, though, the the D in Dxacc... means 'deprecated'.
Eventually, everything needs to use the gnc_numeric versions of functions.

dave