A pure vanilla Javascript way to count decimals of a number. An excellent tiny JavaScript utility to count on the variety of digits after the decimal point in a number.
How to make use of it:
1. Download the library and insert the countDecimals.js proper earlier than the closing body tag.
<script src="countDecimals.js" async></script>
2. Determine the number through which you might want to calculate the variety of digits after the decimal point.
countDecimals(1) // => 0 countDecimals(1.25) // => 2 countDecimals(1.125) // => 3 countDecimals(3/7) // => 17
Calculate The Number Of Digits After Decimal Point, Counting in Decimals, count decimals GitHub
Limit The Number Of Characters Within Input/Textarea | jQuery-maxlength
See Demo And Download
Official Website(TanishShinde): Click Here
This superior jQuery/javascript plugin is developed by TanishShinde. For extra Advanced Usages, please go to the official website.
Be First to Comment