jQuery Plugin To Convert Number Into Abbreviated String - Numbers abbreviation

jQuery Plugin To Convert Number Into Abbreviated String - Numbers abbreviation
File Size: 3.76 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Numbers abbreviation is a tiny jQuery number manipulation plugin which converts / shortens long numbers into more readable abbreviated strings.

How to use it:

1. Load the jQuery Numbers abbreviation plugin after loading jQuery library.

<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="app.js"></script>

2. Wrap the number into an element with the required dataconvert attribute.

<a dataconvert href="#">30000</a>

3. In this case, the plugin will convert 30000 into 30.00K.

4. Override the default parameters.

var customSelector   = "dataconvert";
var kFactor      = "K";
var mFactor      = "M";
var decNumK      = 2;
var decNumM      = 2;
var separator      = '.';
var realNumbers    = [];
var convertedNumbers = [];

This awesome jQuery plugin is developed by hectormunozg. For more Advanced Usages, please check the demo page or visit the official website.