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

d3.median number converting not consistent #2069

Closed
chaosmail opened this issue Oct 16, 2014 · 2 comments
Closed

d3.median number converting not consistent #2069

chaosmail opened this issue Oct 16, 2014 · 2 comments
Labels
bug Something isn’t working
Milestone

Comments

@chaosmail
Copy link

The number conversion in the d3.median function is not consistent. If there is one number value among other strings, the conversion works as expected. If there are solely numbers as string values, the median string is returned. However, if solely characters are passed to d3.median, undefined is returned.

Here are some examples:

d3.median([2,3,20])
returns 3 as expected
d3.median(["2",3,"20"])
returns 3 as expected
d3.median(["2","3","20"])
returns 20 whereas expected 3
d3.median(["a","b","c"])
returns undefined as expected

@jasondavies jasondavies added the bug Something isn’t working label Oct 16, 2014
@jasondavies jasondavies added this to the 3.4.x milestone Oct 16, 2014
jasondavies added a commit that referenced this issue Oct 16, 2014
@jasondavies
Copy link
Contributor

Thanks! Fix added to #2068.

@mbostock
Copy link
Member

Fix staged in #2075 for 3.4.13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Development

No branches or pull requests

3 participants