-
Notifications
You must be signed in to change notification settings - Fork 23
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
toString instead of toLocaleString #226
toString instead of toLocaleString #226
Conversation
✅ Deploy Preview for chipper-sunburst-578cfe ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Havent looked at the front-end code for some time, but why don't we use the displayAmount function here. We know the decimals for the price is fixed, so just display it the same way you display prices in the actual orderbook buys and sells. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having the spread on a row below would be fine, or we could remove the spread value and just show the percentage? |
I agree with using |
even if we remove the spread value, if the price number is very long it might still overlap, moving spread to a row below (but only if they don't fit) would be better |
I think using displayNumber with noDigits set to 10 should work fine. It is very unlikely that prices will ever be more than 9 999 999 999. The priceMaxDecimals for any price higher than 99 999 will be 0. The most decimals a price could ever have is 8, so even in that case a noDigits of 10 should work ("0." and 8 decimals = 10 digits). |
Co-authored-by: EvgeniiaVak <[email protected]>
This is workaround to get correct decimals to display, as the toLocaleString solution causes issues with number display
For example:
The problem is how Number and toLocaleString() loses precision. Example in dev console