Jan 24, 2024
easy-number-separator is a pure JavaScript plugin for formatting and separating currency numbers with coma.
Features
,) or any other characters.
Link this CDN to your HTML file
<script src="https://cdn.jsdelivr.net/gh/amiryxe/easy-number-separator/easy-number-separator.js"></script>
easy-number-separator.js in your html file, or your web project.<script src="js/easy-number-separator.js"></script>
<input type="text" class="currency-input" />
easyNumberSeparator({
selector: '.currency-input',
separator: ','
})
Other options you can pass
| Title | Default | Description |
| selector | eg. .currency-input | Selects the input element |
| separator | , | The character of number separator |
| decimalSeparator | . | The character of decimal separator |
| resultInput | - | Raw number generated for purposes such as server submission and calculations |