jQuery Currency Format Comma Separator on Input

jQuery Currency Format Comma Separator on Input
Code Snippet:
Author:
Published: January 20, 2024
Last Updated: January 22, 2024
Downloads: 12,613
License: MIT
Edit Code online: CodeHim
Read More

Here is an ultra lightweight, simple and easy to use jQuery currency format comma separator plugin to automatically separate input numbers / currency.

You just need to add class name to your numbers input. Then, plugin will auto initialize (to add separators) in that numbers input.

Plugin Overview

Plugin: Easy-Number-Separator
Author: Amir Salehi
Licence: MIT Licence
Published: January 20, 2024
Repository: Fork on GitHub
Dependencies: jQuery 1.3.1 or Latest version
File Type: zip archive (HTML, CSS & JavaScript )
Package Size: 2.89 KB

How to Use Currency Format Comma Separator Plugin

1. First of all load the jQuery JavaScript library and Easy Number Separator‘s JavaScript file into your HTML page.

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

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

2. After that, create input element with type="number" and add class name "number-separator". When user type number in this input, the plugin will auto insert currency format comma separator on typing.

<input type="number" class="number-separator" placeholder="Enter Your Number Here...">

3. The following are some basic CSS styles for input field. However, you can adjust your input anywhere in which you want to auto insert currency format comma on jQuery input.

        input[type='text'] {
            margin: 0 auto;
            padding: 15px;
            border-radius: 5px;
            border: 1px solid #bbb;
            font-size: 36px;
            display: block;
            text-align: center;
            font-family: 'Cairo', sans-serif;
        }

        input[type='text']::placeholder {
            color: #ccc;
        }

        span {
            background: darkorange;
            color: #fff;
            border-radius: 3px;
            padding: 0 5px;
        }

        a{
            text-decoration: none;
            background: #ccc;
            border-radius: 3px;
            padding: 0 5px;
            color: #333;
            opacity: 0.8;
        }

        a:hover{
            opacity: 1;
        }

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About CodeHim

Free Web Design Code & Scripts - CodeHim is one of the BEST developer websites that provide web designers and developers with a simple way to preview and download a variety of free code & scripts. All codes published on CodeHim are open source, distributed under OSD-compliant license which grants all the rights to use, study, change and share the software in modified and unmodified form. Before publishing, we test and review each code snippet to avoid errors, but we cannot warrant the full correctness of all content. All trademarks, trade names, logos, and icons are the property of their respective owners... find out more...

Please Rel0ad/PressF5 this page if you can't click the download/preview link

X