-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve formatting of draws table #203
Conversation
Not sure if there is a good way to avoid the A very-JS suggestion I've seen online is "divide by 1 afterwards", which 1. makes TSC unhappy, but 2. does seem to work, hilariously |
It's JavaScript, of course it makes no sense and yet works! So a couple options here, but they're going to involve writing a helper function. Question is just what that helper function would look like. One solution would be to check if the number is an integer (or within tolerance of an integer) and if so don't do the |
How about detecting whether it's an integer column, and then using a different format function. It will give approximately the same result as having the conditional inside the format function... but I think it's more correct in the rare case where you have a mix of integers and non-integers in the same column. |
@@ -108,7 +108,9 @@ const DrawsView: FunctionComponent<DrawsViewProps> = ({ | |||
>(300); | |||
const draws2 = useMemo(() => { |
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.
As long as you're changing things, might as well make this more semantic--formattedDraws
or the like?
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.
This seems good to me.
Looks good to me |
This rounds to 6 digits and makes it so that resizing the tab doesn't lead to very skinny columns that wrap.
Before:
After: