Terry Boldt <[EMAIL PROTECTED]> writes:
> I have modified with Dave's generous help, one of the current reports. It has
> an 'if' clause:
>
> (if (= (gnc:account-get-balance-at-date acct date #t) 0.00)
>
> The false portion of the 'if' clause is never activated, even when the report
> outputs the result of "(gnc:account-get-balance-at-date acct date #t) " to be
> 0.00
>
> Is the result returned by "(gnc:account-get-balance-at-date acct date #t)" a
> numeric or string?
I haen't looked at the code in question closely, but the problem here
may be that (= x 0.0) is rarely likely to be true, even when you think
it should be. In particular, it will be false, even if x is *very*
close to zero (i.e. (set! x 0.00000000000001)). In most cases, we
should probably have a gnc:financially-zero? predicate, or something
like it (with a better name) that checks to see if a value is small
enough to be considered zero in cases where exactly zero isn't what's
intended.
--
Rob Browning <[EMAIL PROTECTED]> PGP=E80E0D04F521A094 532B97F5D64E3930
--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]