portfolio icon indicating copy to clipboard operation
portfolio copied to clipboard

Kurs/Quote uses double instead of BigDecimal

Open ixidion opened this issue 3 years ago • 4 comments

Describe the bug It seems like there are double values used instead of BigDecimal at some points. This alters the values and can lead to followup calculation errors.

To Reproduce Steps to reproduce the behavior:

  1. Go to "Create new Buy"
  2. Select a stock
  3. enter pieces: 13,47
  4. Enter quote: 13,47

Expected behavior Both should be saved as Decimal-Variables 13,47, but quote is saved as floating point number: 13,46993318

Other part of the program should be checked as well for unintended floating point conversion. Floating points are a "no-go" for financial figures.

Screenshots image

Desktop (please complete the following information):

  • OS: Windows
  • Version: 0.58.5

ixidion avatar Jul 16 '22 17:07 ixidion

The quote price at this screen dump is not used in any calculations, it's simple a help while creating a transaction. In all calculations only the number of shares and gross amount is used.

Morpheus1w3 avatar Jul 16 '22 20:07 Morpheus1w3

The quote price at this screen dump is not used in any calculations, it's simple a help while creating a transaction. In all calculations only the number of shares and gross amount is used.

So the bug is, that the number is converted to a float in the UI?

ixidion avatar Jul 17 '22 09:07 ixidion

If you would like to call it a Bug or whatever, but in here it's just a hint of your entered figures. 13,47 × 13,47 = 181,4409 forces a float as a difference of 0,0009 are present. To avoid calculation mistakes PP is working w/ gross amounts regardless of your input at this field.

Morpheus1w3 avatar Jul 17 '22 19:07 Morpheus1w3

okay, thanks for clarification.

ixidion avatar Jul 17 '22 19:07 ixidion