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

Apply format to trading charts axis Y values #4761

Merged
merged 2 commits into from Nov 10, 2020
Merged

Apply format to trading charts axis Y values #4761

merged 2 commits into from Nov 10, 2020

Conversation

deusmax
Copy link
Contributor

@deusmax deusmax commented Nov 7, 2020

This PR completes the improvements to trading charts introduced in PRs #4715 and #4740, by formatting the Y-axis values of the Price chart as:

  • Fiat: Apply separator format to numbers
  • Crypto: remove some (not all) trailing zeroes from fractional part

Here is the result for the EUR chart, similar for other fiat:
Bisq-charts-Yaxis_EUR-day-2020-11-04

Below are before and after for various cryptos:
XMR before:
Bisq-charts-Yaxis_XMR0-day-2020-11-05
XMR after:
Bisq-charts-Yaxis_XMR-day-2020-11-05
BSQ before:
Bisq-charts-Yaxis_BSQ0-day-2020-11-05
BSQ after
Bisq-charts-Yaxis_BSQ-day-2020-11-05
ETH before:
Bisq-charts-Yaxis_ETH0-week-2020-11-05
ETH after:
Bisq-charts-Yaxis_ETH-week-2020-11-05

What do you think ?

Format currency tick values as integers for a more
compact form, without the 4-zeroesfractional part.
The y-axis tick mark labels for crypto (non-fiat)
currencies have a large number of trailing zeroes.
This commit removes the last 3 zeroes from the display.
Copy link
Member

@ghubstan ghubstan left a comment

Choose a reason for hiding this comment

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

utACK

Copy link
Member

@ghubstan ghubstan left a comment

Choose a reason for hiding this comment

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

Are you sure the first three zeros being replaced will always be the three trailing zeros?

@deusmax
Copy link
Contributor Author

deusmax commented Nov 9, 2020

@ghubstan
Yes. A RegEx is used that anchors at the trailing end of the string, so only the last zeroes are matched. It can not have multiple matches.
The use of either function replaceFirst or replaceAll does not matter.

Copy link
Member

@ghubstan ghubstan left a comment

Choose a reason for hiding this comment

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

Yes. A RegEx is used that anchors at the trailing end of the string, so only the last zeroes are matched. It can no have multiple mathches.
The use of either function replaceFirst or replaceAll does not matter.

Missed that... thanks.

utACK

Copy link
Member

@ripcurlx ripcurlx left a comment

Choose a reason for hiding this comment

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

utACK

@ripcurlx ripcurlx merged commit f6a2f3d into bisq-network:master Nov 10, 2020
@deusmax deusmax deleted the trading_charts_axisY branch December 2, 2020 11:34
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.

None yet

3 participants