Daniele Nicolodi wrote:
> On 02/03/23 15:53, fin wrote:
>>    i'm trying to wade through all these various docs and
>> mentions about precision because i'm trying to figure out
>> why certain transactions do not balance (and fava complains).
>
> Your example below does not balance for 1087.5 USD. Why do you think it 
> due to precision or rounding?

  because i'm working from a combinations of examples and
don't really understand them well enough yet.  :)

  i'm trying to use the dated lot signification and then
also working from the split description and then also your
noted link below about trading.  i did read through them 
but misunderstood something.  i'll figure it out eventually
now that i know the error is indeed something i did wrong
and not the error/rounding issue.

  somehow i messed up and don't know how yet to fix it to 
preserve the original lot date.

  also, i really should know more about bean-doctor and
thanks for reminding me about that.  using fava is not
always the quickest way for me to learn but i'm too used
to clicking these days...


>>    my assumption is that using the Decimal Python type should
>> remove a lot of internal conversion issues since because the
>> data is starting out as strings that any calculations should
>> be as accurate as possible given those strings to start with.
>> 
>>    is there a way right now to tell beancount to only use
>> Decimal internally?
>
> Beancount uses Decimal everywhere.

  ah, good to know.  :)


>> my test data, importer and fava tells me that this doesn't balance:
>> 
>> 
>> 2000-01-01 * "Split 2 FOR 1"
>>    input: "01/01/2000,20000101-001,Split 2 FOR 1,,INTC,,,,,,,"
>>    transId: "20000101-001"
>>    lot: "43.5 USD, 1999-01-01"
>>    Assets:SB:WHS:INTC         -25 INTC {43.5 USD, 1999-01-01} @ 43.5
>>    Assets:SB:WHS:INTC         50 INTC {43.5 USD, 1999-01-01} @ 21.75
>
> Combining prices and costs is tricky. See 
> https://beancount.github.io/docs/how_inventories_work.html#price-vs-cost-basis
> and https://beancount.github.io/docs/trading_with_beancount.html

  i did read through them but i misunderstood some part(s) of 
them.


> The problem with the transaction above is that the cost annotation for 
> one of the two postings above must be wrong: you cannot sell 25 INCT at 
> 43.5 USD, and buy 50 INTC at 43.5 USD without having 1087.50 USD come 
> from somewhere.

  i see that now.  :)  i just do not want to lose the original
lot date and don't know how i would reference that original lot
after the split.  currrently in my program i keep the original
designation as the lot string even if the price changes due to
the split (at least that was what i thought i was doing).


  if i change that 2nd line to:

    Assets:SB:WHS:INTC         50 INTC {21.75 USD, 1999-01-01} @ 21.75
or
    Assets:SB:WHS:INTC         50 INTC {21.75 USD, 1999-01-01}

  will that preserve the lot date?  and will i have to reference it
by the new "21.75 USD, 1991-01-01" or would i still be using the
original "43.5 USD, 1999-01-01"?

  i can work with this either way i just want to know which it
is.  which syntax works?

  thanks for pointing me in the right direction.  i was trying
to chase a problem that wasn't there and made little headway
(which is why i asked).


  fin

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/tf67dj-3gb.ln1%40anthive.com.

Reply via email to