fava icon indicating copy to clipboard operation
fava copied to clipboard

Price column in Journal page does not follow precision of price in beancount file

Open harishmohanadas opened this issue 5 years ago • 2 comments

It appears that the Price column in Fava's Journal page does not follow the precision of the price provided in the beancount file.

Below is a sample showing a beancount file transaction with a price attached to the posting to 4 decimal places.

image

The Price column in the Journal page however only shows the price to 2 decimal places.

image

Is the above display behaviour the expected one? It differs from bean-web, shown below

image

The main issue is that the display of the Journal page in Fava makes it appear as though the price doesn't tally with the other legs of the transaction, i.e

37.00 x 1.55 = 57.35 which does not round off to 57.23.

I also attach beancount's dcontext option reported by Fava below. The above behaviour is the same in both Firefox and Chromium. Fava version is 1.14. Beancount version is 2.2.3.

image

Many thanks.

harishmohanadas avatar Mar 07 '20 17:03 harishmohanadas

Is the above display behaviour the expected one?

It is the currently expected behaviour. My reason for using the display context here was that I mainly use the @ syntax with a missing price - the price is then inferred, which usually leads to numbers with lots of decimal places.

We could show the full price as a tooltip on hover maybe?

yagebu avatar Mar 12 '20 16:03 yagebu

I see the problem of lots of decimal places in bean-web when using the @ syntax with a missing price.

Could I suggest using the fractional_max part of the display context for determining the decimal places for the price column?

I notice that fractional_max adjusts to the decimal places of the price input into the beancount file, i.e.

37.00 EUR @ 1.5467 SGD results in fractional_max=4 for SGD 37.00 EUR @ results in fractional_max=2 for SGD

Alternatively, using the exact price written in the beancount file may be an option, but this could deviate from the display context.

harishmohanadas avatar Mar 15 '20 06:03 harishmohanadas