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

Bring back d3.round? #32

Closed
mbostock opened this issue Nov 23, 2016 · 1 comment
Closed

Bring back d3.round? #32

mbostock opened this issue Nov 23, 2016 · 1 comment
Assignees

Comments

@mbostock
Copy link
Member

Seems like it is reasonable, after all: d3/d3-path#10 (comment)

Proposed implementation:

function round(x, n) {
  return n == null ? Math.round(x) : Math.round(x * (n = Math.pow(10, n))) / n;
}
@mbostock mbostock self-assigned this Nov 23, 2016
@mbostock
Copy link
Member Author

mbostock commented Sep 5, 2019

Not currently planning on doing this because it feels out of place in a number-formatting library.

@mbostock mbostock closed this as completed Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant