jQuery Easy Number Separator

August 06, 2019 No comments jQuery Number Separator

1. Introduction

Easy-Number-Separator is a jQuery plugin for currency format with a specified separator. The plugin separates numbers with a comma , automatically in realtime when typing. It works on any text input field and accepts also dot character for decimals. To start using it we have to add one class number-separator to the input field.

Easy number separator in jquery

2. Plugin Overview

Library Easy-Number-Separator
Author Amir Salehi
Licence MIT Licence
Repository GitHub
Dependencies jQuery 1.3.1 or Latest version


3. How to install and use Easy-Number-Separator jQuery plugin

Steps below shows how to install Easy-Number-Separator plugin.

1. first, include jQuery in your project

<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>

2. add Easy-Number-Separator plugin

<!-- Easy Number Separator JS -->
<script src="js/easy-number-separator.js"></script>

3. create HTML input field with number-separator class

<input type="text" class="number-separator" value="">

Easy-Number-Separator plugin will automatically attach to any field with number-separator class.

4. Conclusion

In this article, we presented a Easy-Number-Separator jQuery plugin that can be used to format numbers in input fields on your website. The plugin is easy to integrate, very lightweight and comes with many nice features. It can be used to format the amount in payment forms.

{{ message }}

{{ 'Comments are closed.' | trans }}