Currently when using numeral(1000000).format('0a')
will return 1m
, however is it possible to set a scale, for example thousands
, so any number will get converted to a number in thousands?
For instance 1000000 will become 1000k, and 100 would become 0,1k and so on.
console.log(
numeral(1000000).format('0a')
);
<script src="https://cdnjs.cloudflare.com/ajax/libs/numeral.js/2.0.6/numeral.min.js"></script>