KomodoPlatform / komodo-wallet

Komodo Wallet
https://app.komodoplatform.com
239 stars 206 forks source link

Fix/dexpro/orderbook/bignum alignment #2465

Closed smk762 closed 1 month ago

smk762 commented 2 months ago

Closes https://github.com/KomodoPlatform/komodo-wallet-desktop/issues/2427

To test:

cipig commented 2 months ago

it now looks like this image pay attention to the bids... there is one for 30k MAZA and one for 300k MAZA... they look the same (because they have a different number of decimals) the ask for 9k and the one for 99k also look the same i fear we can't solve the problem by using different number of decimals for different entries in same view... we need to cut down the decimals for all entries to the same number or we need to make the column wider

AndrewDelaney commented 2 months ago

Everything does look very nice and neatly aligned. The only issue I have is with the column headings, and the amount of space left unutilised. I agree with @cipig, the columns can be made wider. I have created a proposed idea for an improved layout that may remedy the issue @cipig raised.

Before After
OrderBookAlignment OrderBookAlignment(Proposal)

This layout will help show more of the number and make it easier to compare. I know we round to 8 decimal places, but perhaps we should round down to the last non-zero digit within the 8 decimal places? Then right aligning all the columns to make comparisons easier. e.g. 70.540000000085 -> 70.54 45.00000000 -> 45.0 97.6800430000091 -> 97.680043

Just an idea, though this is a lot more work than simple alignment, and we'd have to look at changing it across the board.

cipig commented 2 months ago

This layout will help show more of the number and make it easier to compare. I know we round to 8 decimal places, but perhaps we should round down to the last non-zero digit within the 8 decimal places?

the values in the columns should be right-aligned, not left-aligned, so you can see right away which value is bigger... and you can only do that if all values have the same number of decimals, if they differ it does not work... and now they differ, see image one is 30k, the other 300k, but they "look" the same if you don't start counting decimals

ShantanuSharma9873 commented 2 months ago
cipig commented 2 months ago

if we need to save space, we could reduce the number of decimals for "Quantity" and "Total" to 6, in general, for all coins/orderbooks... for BTC (the coin with highest value in USD) the min. volume in a swap is anyway 0.00777000, so orders with lower volumes can't be posted... besides that, default dust for all coins is 546 sats (0.00000546)

atm this change makes it worser, since it "damages" orderbooks that previously looked fine, like DOGE/KMD: image

cipig commented 2 months ago

just realized that we already had it to 6 decimals for "Quantity" and "Total" this is how DOGE/KMD orderbook looks like without this PR: image and MAZA/KMD: image the big orders seen in https://github.com/KomodoPlatform/komodo-wallet-desktop/issues/2427#issue-2233330136 are gone in the meantime, so the problem is only with big numbers, then it gets unaligned... i fear the only way to solve it is to make tab wider