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

Change orderbook text alignment #1491

Merged
merged 8 commits into from
Dec 14, 2021
Merged

Change orderbook text alignment #1491

merged 8 commits into from
Dec 14, 2021

Conversation

ghost
Copy link

@ghost ghost commented Dec 9, 2021

Fix # 1488

@ghost ghost requested a review from smk762 December 9, 2021 13:58
@cipig
Copy link
Member

cipig commented Dec 9, 2021

image

values are right-aligned now, thanks
can you make ADEX not cut them off, so all values have the same number of decimals (whatever that number may be)
you can simply make the column wider, there is plenty of unused space on the left anyway

image

@ghost
Copy link
Author

ghost commented Dec 10, 2021

you can simply make the column wider, there is plenty of unused space on the left anyway

The empty space you're talking about is the one between the Quantity column and Price column right ?
If yes, that's not really true, there is not available space between those two because the quantity values on your screen are too small to fill the column's real width

I'm currently trying other solutions, one might be to reduce font pixel size

Edit font pixel size

Change hover effect behavior
@ghost
Copy link
Author

ghost commented Dec 10, 2021

I also reduced the number of displayed decimals to 6

@ghost ghost requested a review from cipig December 10, 2021 13:26
@cipig
Copy link
Member

cipig commented Dec 10, 2021

The empty space you're talking about is the one between the Quantity column and Price column right ?

I was talking about the space left to orderbook, where the chart would be drawn. That space is huge while we are taking here about couple decimals.
Reducing decimals to 6 is not a good idea, since prices in BTC are very often only 1-10 sats. What makes sense to reduce to 6 is the quantity, but afaik that is already the case.
Isn't there a function in QT to say "show me the values with 12 (or whatever) significant places", like

0.12345678
12.34567890
123.45678901
12345678.9012

@cipig
Copy link
Member

cipig commented Dec 10, 2021

image
in this case it does not even make sense to replace the decimals with ...
replacing 2 decimals with 3 . does not save space :-)

@cipig
Copy link
Member

cipig commented Dec 10, 2021

image

here you see the problem with 6 decimals on price, even on DGB/BTC it does not fit
price of DGB is 0.00000074 BTC: https://coinpaprika.com/coin/dgb-digibyte/
orderbook shows an entry with 0.000001... it's likely something like 0.00000077 or so
and for other coins it should actually be more like 10 decimals, see also #955, but that is another story :-)
here: https://coinpaprika.com/coin/bidr-binanceidr/ ... price is 0.000000001443 BTC... 12 significant digits would actually fit well... but that is not possible in mm2 anyway atm, hope it will be in future, so i can post orders for BIDR/BTC too

@cipig
Copy link
Member

cipig commented Dec 10, 2021

i changed decimals for price back to 8 in my repo: cipig@e61c4d5
works fine, eg DGB/BTC
image

now please just get rid of those ..., so all values have the same amount of decimals
image

keeping the decimals of Quantity and Total to 6 is totally fine.. can even be reduced to 5 for both... 0.000001 BTC (6 decimals) is 0.05 USD, with 5 it would be 0.50 USD... but for price we need 8 decimals

@cipig
Copy link
Member

cipig commented Dec 11, 2021

image
same orderbook with 5 decimals for Quantity and Total, the ... are gone
cipig@2f5e998

still some cases like this
image

so we should find a better solution other then using fixed number of decimals (the coins have very different valuations from 50000 USD for BTC to 0.00006 USD for BIDR or whatever
but going with 8, 5, 5 for price, quantity and total is good enough for the beginning

@cipig
Copy link
Member

cipig commented Dec 11, 2021

btw, why can't i resize the orderbook? i have a huge screen, but the most important things (orderbook and best orders) are tiny, so i can barely see the values, while the rest of the screen is unused
image
adding a handful of pixels to that orderbook or make it resize with the rest of the screen would not make it necessary to cut 2 decimals, just to make it readable

@ghost
Copy link
Author

ghost commented Dec 13, 2021

I increased the width of the orderbook

Also displayed numbers are now strings instead of numbers: they will show up to 10 significant decimals for the price and 8 for the quantity and total

I also reverted the font size to 12

image

@Milerius
Copy link

Milerius commented Dec 13, 2021

I increased the width of the orderbook

Also displayed numbers are now strings instead of numbers: they will show up to 10 significant decimals for the price and 8 for the quantity and total

I also reverted the font size to 12

image

Could you please use the last version tag of https://github.com/MikeMcl/bignumber.js (v.9.0.2) so we don't rely on last master commit.

@ghost
Copy link
Author

ghost commented Dec 14, 2021

As discussed with @cipig in private this work will need more research (API and frontend side) for special cases like particular pairs with numerous digits.

To prevent any overflow issue we replaced the use of numeric types by strings in the orderbook

This PR can be reviewed, research will be continued in #1488: please do not close this isssue if this PR is merged, and rename it if necessary.

Copy link
Member

@cipig cipig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
thanks a lot for the changes and all your efforts

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

Successfully merging this pull request may close these issues.

2 participants