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

Trim trailing zero when formatting numbers #1760

Merged
merged 1 commit into from
Jan 17, 2019

Conversation

stephanwlee
Copy link
Contributor

d3.formatter now supports trim trailing zero with "~". For instance,
number 0.1 used to result in "0.100" but now is "0.1". This does not
affect numbers like "0.1234" and both formatter result in "0.123".

Screenshots of UI changes

Before

image

After

image

Copy link
Contributor

@wchargin wchargin left a comment

Choose a reason for hiding this comment

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

Nice; thanks!

@nfelt
Copy link
Contributor

nfelt commented Jan 15, 2019

Cool. Does this have any effect on the scientific notation behavior or the fact that due to rounding sometimes we show the same number for multiple tick marks? E.g. re: #1205

@stephanwlee
Copy link
Contributor Author

@nfelt nope, that's a separate issue related to how we format. I was going to fix that in a separate PR.

@wchargin
Copy link
Contributor

While we’re collecting related axis-formatting issues, #1753 (event file
included) might be good to be aware of if you’re not already.

d3.formatter now supports trim trailing zero with "~". For instance,
number 0.1 used to result in "0.100" but now is "0.1". This does not
affect numbers like "0.1234" and both formatter result in "0.123".
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.

3 participants