How to use the blessed-contrib/lib/utils.abbreviateNumber function in blessed-contrib

To help you get started, we’ve selected a few blessed-contrib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dashersw / brain-monitor / lib / override-blessed-contrib.js View on Github external
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
    }