Skip to content

Latest commit

 

History

History
73 lines (64 loc) · 1.44 KB

README.md

File metadata and controls

73 lines (64 loc) · 1.44 KB

numericText

Converts Number to Short Textual value.

Examples :

  • 100000 -> 1.00 Lakh (Indian) or 100.00 Thousand (International)
  • 3453232 -> 34.53 Lakh (Indian) or 3.45 Million (International)

Options :

Option Default Possible values Description
type 'indian' 'indian', 'international' Type of texual currency.
shortHand true true, false Whether full currency text is required or short form.
minimum 2 Integer value greater than 2 Minimum number of digits after which number should be converted to text.
decimal 2 Integer value (>=0) Number of digits after decimal point.

Usage

  1. Add jQuery
  2. Add numericText
  3. Use jQuery selector to convert number to short text

e.g.

//html 231245.45 //js $("span#num").numericText();

or

//html
<input class="textCurr" value="234534.789"/>
//js
$(".textCurr").numericText({
  type:'international'
});

License

numericText is released under the MIT license.