[GNC] Check for negative amount in scheduled transaction formula

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[GNC] Check for negative amount in scheduled transaction formula

gnucash.dgr9z
Hi,

Is it possible to convert negative numbers to 0 in a formula? something like:
a-b < 0 ? 0 : a-b

If this needs to be defined as a function someplace, what would it look like, where would it go, and how would it be called from the template?

Many thanks,
Ron
_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Check for negative amount in scheduled transaction formula

Derek Atkins-3
[hidden email] writes:

> Hi,
>
> Is it possible to convert negative numbers to 0 in a formula? something like:
> a-b < 0 ? 0 : a-b
>
> If this needs to be defined as a function someplace, what would it
> look like, where would it go, and how would it be called from the
> template?

Look at fin.scm and copy the functions in there.

> Many thanks,
> Ron

> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

-derek

--
       Derek Atkins                 617-623-3745
       [hidden email]             www.ihtfp.com
       Computer and Internet Security Consultant
_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Check for negative amount in scheduled transaction formula

Ron Stone
Thanks for this Derek. I'm on a Mac and only see one copy of fin.scm in the application bundle. Seems any edits to this would be lost at the next upgrade. Should I be defining another one somewhere under ~/Library/Application Support/GnuCash or elsewhere?

Ron

----- Original Message -----
From: "Derek Atkins" <[hidden email]>
To: "gnucash dgr9z" <[hidden email]>
Cc: "Gnucash Users" <[hidden email]>
Sent: Monday, January 21, 2019 3:16:52 PM
Subject: Re: [GNC] Check for negative amount in scheduled transaction formula

[hidden email] writes:

> Hi,
>
> Is it possible to convert negative numbers to 0 in a formula? something like:
> a-b < 0 ? 0 : a-b
>
> If this needs to be defined as a function someplace, what would it
> look like, where would it go, and how would it be called from the
> template?

Look at fin.scm and copy the functions in there.

> Many thanks,
> Ron

> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

-derek

--
       Derek Atkins                 617-623-3745
       [hidden email]             www.ihtfp.com
       Computer and Internet Security Consultant
_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|

Re: [GNC] Check for negative amount in scheduled transaction formula

Derek Atkins-3
Hi Ron,

Ron Stone <[hidden email]> writes:

> Thanks for this Derek. I'm on a Mac and only see one copy of fin.scm
> in the application bundle. Seems any edits to this would be lost at
> the next upgrade. Should I be defining another one somewhere under
> ~/Library/Application Support/GnuCash or elsewhere?

Yes, this file will be over-written at the next upgrade.
Creating a new file would require you to get gnucash to load it..

IMHO, you should make the edits to fin.scm now, and then make a patch
and submit to to Bugzilla for inclusion in future versions.

> Ron

-derek

> ----- Original Message -----
> From: "Derek Atkins" <[hidden email]>
> To: "gnucash dgr9z" <[hidden email]>
> Cc: "Gnucash Users" <[hidden email]>
> Sent: Monday, January 21, 2019 3:16:52 PM
> Subject: Re: [GNC] Check for negative amount in scheduled transaction formula
>
> [hidden email] writes:
>
>> Hi,
>>
>> Is it possible to convert negative numbers to 0 in a formula? something like:
>> a-b < 0 ? 0 : a-b
>>
>> If this needs to be defined as a function someplace, what would it
>> look like, where would it go, and how would it be called from the
>> template?
>
> Look at fin.scm and copy the functions in there.
>
>> Many thanks,
>> Ron
>
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.
>
> -derek

--
       Derek Atkins                 617-623-3745
       [hidden email]             www.ihtfp.com
       Computer and Internet Security Consultant
_______________________________________________
gnucash-user mailing list
[hidden email]
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.