This jQuery plugin provides a way to format a large number in a pretty human readable format. For example, 100000 (one hundred thousand) would be printed as 100K.
In your head tag, include jQuery and this plugin:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="jquery.prettyNumbers.js" type="text/javascript"></script>
<div class="pretty-number">123456</div>
$( function() {
$('.pretty-number').prettNumber();
});
<div class="pretty-number" data-pretty-number="123456" title="123456">1.2K</div>
Elements modifiable by prettyNumber include: div, span, a
If needed, it can easily be modified to add support for additional element types.
The input element is specifically excluded from this list as the intention of the plugin is purely for presentation of data, not for data input.
Check the sample directory for an example on how to use the plugin.
You can also hop over to a jsfiddle for a live example.