Skip to content

Commit

Permalink
Method Refresh doesn't work with Value zero. #359
Browse files Browse the repository at this point in the history
Added isNumber Function
  • Loading branch information
Job Louage committed Feb 15, 2021
1 parent b6ef2da commit 4db6c0f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 30 deletions.
20 changes: 6 additions & 14 deletions dist/justgage.js
Original file line number Diff line number Diff line change
Expand Up @@ -838,20 +838,8 @@
var obj = this;
var displayVal, color;

if (Number.isInteger(max) || Number(max) === max && max % 1 !== 0) {
//max is an integer or decimal
//If the mod of a number divided by 1 is not equal to zero then it must a float number.
max = max;
} else {
max = null;
}
if (Number.isInteger(min) || Number(min) === min && min % 1 !== 0) {
//min is an integer or decimal
//If the mod of a number divided by 1 is not equal to zero then it must a float number.
min = min;
} else {
max = null;
}
max = isNumber(max) ? max : null
min = isNumber(min) ? min : null
label = label || null;

// set label min
Expand Down Expand Up @@ -1345,5 +1333,9 @@
return out;
};

function isNumber(n) {
return n !== null && n !== undefined && !isNaN(n)
}

return JustGage
}));
2 changes: 1 addition & 1 deletion dist/justgage.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 4db6c0f

Please sign in to comment.