Skip to content

Conversation

@fdpamb
Copy link

@fdpamb fdpamb commented Jul 9, 2020

No description provided.

var binIndex = Math.floor((item - min) / binSize);
// for values that lie exactly on last bin we need to subtract one
if (binIndex === numBins) {
if (binIndex === numBins || JSON.stringify(binIndex) === numBins) {
Copy link
Owner

Choose a reason for hiding this comment

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

@fdpamb I'm just getting around the updating this module. Thanks for the suggestions. I don't think I will merge this change, as I consider it to be responsibility of the module to handle parameters in multiple types. The user can easily convert this a number prior to calling the function

let binIndex = Math.floor((item - min) / binSize);
// for values that lie exactly on last bin we need to subtract one
if (binIndex === numBins) {
if (binIndex === numBins || JSON.stringify(binIndex) === numBins) {
Copy link
Owner

Choose a reason for hiding this comment

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

Same comment as above. I don't think it is the module's responsibility to accept parameters of multiple types. The user can easily convert to correct type prior to calling the module

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.

2 participants