status-im / status-desktop

Status Desktop client made in Nim & QML
https://status.app
Mozilla Public License 2.0
298 stars 79 forks source link

Review amount rounding #8640

Closed alaibe closed 1 year ago

alaibe commented 1 year ago

How many decimal places to display for each currency? Fiat currencies should always be displayed using the ISO defined no. of decimal places, see https://bit.ly/34eSF71 Stablecoins that are pegged to a fiat currency should always use the same number of decimal places used by the fiat currency it is pegged to.

Number of decimal places for floating crypto currencies are defined by two factors: firstly, always use the minimal number of decimal places needed. There should never be zeros at the end of decimal places e.g. “2.4 ETH” is correct and “2.40 ETH is incorrect. secondly, the maximum number of decimal places should be defined as the number of decimal places needed so that a “1” in the final decimal place always has a value of between $0.01 and $0.10 USD. e.g. when ETH is priced at $365 four decimal places should be used for ETH because 0.0001 ETH = $0.036 USD which is between $0.01 and $0.10 USD. When ETH rises to $1,000 USD, the UI should change to displaying ETH to five digits. To give another example when 1 SNT is worth $0.024860 USD, no decimal places should be used when displaying sums in SNT because 1 SNT = $0.024 which is between $0.01 and $0.10 USD.

(Clarifications from John) Regardless of the main currency chosen by the user, the number of decimals for floating cryptos should be tied to their value in US Dollars. For example, choosing ARS should not change how many decimals are shown for ETH. The value doesn't need to be refreshed too often (once every 24h is enough)

We should use a consistent format across the whole application. For both fiat and crypto we should always put the code (BTC, ARS, USD) after the amount number. Dot/Comma should be used according to the locale.

By default, always show up to single-digit billions. If there's not enough space, remove decimal places. If there's still not enough space, use some shorter format (k's, M's, B's) -> Split to different issue https://github.com/status-im/status-desktop/issues/8917

Since changing this for the whole wallet in a single PR was too much. Some parts were split to different issues:

anastasiyaig commented 1 year ago

@dlipicar the issue is in QA (was) but PR is in progress. I moved the task to In Progress, please adjust statuses if it does not reflect current picture (reality) :) Thank you!

dlipicar commented 1 year ago

@anastasiyaig it's ready for QA! I just used the time before it got reviewed to make some more changes in that PR instead of splitting them to a separate one.