Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function formatYLabel(value, max, min, numLabels, wholeNumbersOnly, abbreviate) {
var fixed = (max / numLabels < 1 && value != 0 && !wholeNumbersOnly) ? 2 : 0
var res = value.toFixed(fixed)
if (self.options.yLabels)
return '' + self.options.yLabels[Math.round(value * numLabels / (max - min))]
return abbreviate ? utils.abbreviateNumber(res) : res
}