Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pledges should be displayed in decimal notation #2281

Open
dotmacro opened this issue Aug 5, 2024 · 2 comments
Open

Pledges should be displayed in decimal notation #2281

dotmacro opened this issue Aug 5, 2024 · 2 comments

Comments

@dotmacro
Copy link
Member

dotmacro commented Aug 5, 2024

Problem

On testing, regardless of how the user enters a pledge of ".0000002 BTC", after the pledge is saved, the UI displays it as "2e-7".

pledge--scientificNotation

Solution

Pledges should be displayed in decimal notation. Testing didn't uncover other instances of this issue, but all numbers should be displayed in decimal notation.
NOTE: The UI allows the user to enter "2e-7" as a pledge. This is not a problem, but it's also OK to require the user to enter a pledge in decimal notation if that's required to solve this issue.

@snowteamer
Copy link
Collaborator

snowteamer commented Sep 22, 2024

@dotmacro I couldn't reproduce this issue, as the app only supports USD as group currency on my end. How can I change the group currency?

Regardless, the UI does allow exponential notation in USD pledges, whereas the decimal notation is restricted to only two decimal places after the dot. Therefore, exponential notation allows entering amounts which are otherwise rejected as invalid in decimal notation. Other parts of the UI will then round and report the amount in decimal notation, e.g. 6e-3 USD is displayed as $0.01, which is not exactly the same amount.

Not sure if this can become a problem though.

@dotmacro
Copy link
Member Author

dotmacro commented Oct 31, 2024

@snowteamer Sorry for missing your question!
The app doesn't support changing currency anymore (that was a recent PR). However, you can choose USD, EUR, or BTC as the default group currency when creating a group.

I sent you an invite link to a BTC mincome group via DM.

Other parts of the UI will then round and report the amount in decimal notation, e.g. 6e-3 USD is displayed as $0.01, which is not exactly the same amount.

Good catch! I don't think this is a big problem because a) few users are likely to enter numbers in exponential notation; b) in most currencies, the rounding is a very small amount; c) the smallest amount users can send/receive for most payments is also the smallest unit displayed in decimal notation. I've created a new issue for that: #2409

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants