[GNC] Order of transactions

Adrien Monteleone adrien.monteleone at lusfiber.net
Fri Mar 8 18:39:47 EST 2019


I understood that already, but thanks for the detail.

What doesn’t work is sorting off the nnnn part, because the sorting stops at “.”, correct?

That’s why you can’t use “:” in the faux timestamp as the sorting will stop before it gets to the minutes portion, and why you have to use a 24 hour notation because “a/am” or “p/pm” will be ignored.

Regards,
Adrien

> On Mar 8, 2019, at 1:55 PM, Derek Atkins <derek at ihtfp.com> wrote:
> 
> Adrien,
> 
> On Fri, March 8, 2019 2:41 pm, Adrien Monteleone wrote:
>> I didn’t mean to still be able to sort by the real transaction number, but
>> if you have one, and you’ve repurposed the NUM field, you’ll likely want a
>> place to put it just for reference. I simply offered an overview of the
>> remaining options. Overloading NUM as a time field is pretty much giving
>> up on using it to hold a real transaction number. (though one user piped
>> in they used a yyyy.nnnn format that seems to work, though I don’t see how
>> with the intervening “.”)
> 
> As I said, the string field is converted to an integer using the
> C-language atoi() function and then the sort happens using the numerical
> value.  So the string yyyy.nnnn with be converted into the number yyyy and
> that will be used to sort.  If yyyy is 0001, this would be sorted before a
> yyyy of 2.  Basically, the conversion for sorting will stop at the first
> non-numeral character.  That's why using yyyy.nnnn works.  Or yyyy-nnnn. 
> Even yyyyAnnnn will work (this is all assuming the yyyy and nnnn are all
> numerals).
> 
> So 00011.16298462 will come before 2.294362.   If it were a pure string
> compare, then this would not be the case.
> 
>> 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
>       derek at ihtfp.com             www.ihtfp.com
>       Computer and Internet Security Consultant
> 
> 




More information about the gnucash-user mailing list