JSFiddle - React, Tailwind, and code Playground

by evan

HTML

<div class="xxx"></div>

JavaScript

var tiny = function (x) {
    var m = Math.floor(Math.LOG10E * Math.log(x) / 3),
        s = ['', 'K', 'M', 'B', 'T', 'Q'];
    x = x.toString();
    return x.substr(0, x.length % 3) + s[m];
};

$('.xxx').text("" + tiny(243332409));