|
From: | Florian Jung |
Subject: | [Taler] Possible rounding bug in wallet? |
Date: | Tue, 6 Dec 2022 00:16:39 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 |
Hi,
I have an exchange configured with zero fees:
for i
in `seq 2022 2100`; do
taler-exchange-offline wire-fee $i iban MANA:0
MANA:0 | taler-exchange-offline upload
taler-exchange-offline global-fee $i MANA:0
MANA:0 MANA:0 365d 365d 100 | taler-exchange-offline upl
oad
done
my coins exist in
denominations of 100, 10, 1, 0.1, 0.01, and have zero fees
configured.
When I use the Android app to withdraw an amount of 13.37 MANA, it shows me the following screen:
Withdraw: 13.36 MANA
Selected amount: 13.36999999 MANA
Fees: -0.00999999 MANA
To me, this smells badly like a floating-point rounding issue. I might have provoked this with my rather wide-spaced coin denominations, but still, this shouldn't happen. (floating point numbers shouldn't be used for monetary amounts in general)
Can you confirm this as a bug, or is there something weird in my setup?
Cheers,
Florian
PS: you can try my deployment
using `podman-compose` (like docker, but without docker). It's
available online at https://github.com/Windfisch/taler-podman;
the commit i tested this issue with is
a55f34fdc4d0ca91bd9f8524aeafe3989255278c
[Prev in Thread] | Current Thread | [Next in Thread] |