Problems testing the sign of a commodity collector.

Michael McKay michael.mckay at
Sun Jan 25 19:23:01 EST 2009

I'm having problems testing the sign of a commodity collector.

I've modified the income statement to show gross margin and EBITDA.  I've
removed the option for multiple columns and put all the results in a single
table.  It all works well except for the following:

The original scm code used this:

	   (if standard-order? 
	   (string-append (_ "Net income") period-for)
	   (string-append (_ "Net loss") period-for)
	   (* 2 (- tree-depth 1)) exchange-fn #f #f

I'd like to replace it with:

	  (add-subtotal-line my-table 
	    (if (gnc-numeric-negative-p (net-income))
	      (string-append (_ "Net loss") period-for)
	      (string-append (_ "Net income") period-for)
	    #f net-income)

Net-income is defined as

     (set! net-income (gnc:make-commodity-collector))

Everything works but the if statement. What am I missing?

Thanks in advance.

Michael McKay

Web site: 
Web log: 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Michael J  McKay CD MBA.vcf
Type: text/x-vcard
Size: 4484 bytes
Desc: not available
Url : 

More information about the gnucash-devel mailing list