Getting the sign of a gnc-monetary

Charles Day cedayiv at gmail.com
Mon Apr 27 19:49:08 EDT 2009


Doesn't gnc:gnc-monetary-amount result in a gnc-numeric? So how about
something like:
(gnc-numeric-negative-p (gnc:gnc-monetary-amount pair))

-Charles


On Mon, Apr 27, 2009 at 4:26 PM, Chris Dennis <cgdennis at btinternet.com>wrote:

> Pop quiz:
>
> Is there a better way of finding the sign of a gnc-monetary
> amount/commodity pair than this?
>
>  (define (pair-neg? pair)
>    (< (gnc:gnc-numeric-num (gnc:gnc-monetary-amount pair)) 0))
>
> It seems cumbersome, but I can't find anything better.
>
> Should there be a (gnc:gnc-monetary-neg?) predicate in gnc-numeric.scm?
>  And/or (gnc:gnc-numeric-neg?) ?
>
> Just something I thought of while trying to make an eguile-based balance
> sheet with negative values in red.
>
> cheers
>
> Chris
> --
> Chris Dennis                                  cgdennis at btinternet.com
> Fordingbridge, Hampshire, UK
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
>


More information about the gnucash-user mailing list