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?

   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.

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

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.

Cheers,
Dan

--
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/64169db7-2c1a-98bb-5382-5a961e741a79%40grinta.net.

Reply via email to