Press "Enter" to skip to content

Count Number of Digits After Decimal | Javascript Count Decimals

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

Read More  A JavaScript Dropdown Menu Plugin with Virtual Scrolling

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

    Leave a Reply

    Your email address will not be published. Required fields are marked *