https://github.com/amiryxe/easy-number-separator
Easy Number Separator is a plugin for live separate input numbers in textboxes
https://github.com/amiryxe/easy-number-separator
currency input javascript keypress number price pure-javascript separator
Last synced: 6 months ago
JSON representation
Easy Number Separator is a plugin for live separate input numbers in textboxes
- Host: GitHub
- URL: https://github.com/amiryxe/easy-number-separator
- Owner: amiryxe
- Created: 2019-06-13T14:55:17.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T05:44:48.000Z (over 2 years ago)
- Last Synced: 2023-05-14T16:15:26.889Z (about 2 years ago)
- Topics: currency, input, javascript, keypress, number, price, pure-javascript, separator
- Language: HTML
- Homepage: https://amiryxe.github.io/easy-number-separator/
- Size: 57.6 KB
- Stars: 20
- Watchers: 0
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Easy Number Separator
Easy Number Separator is a useful pure JavaScript plugin for currency format and separate numbers on input.
### View Demo
### Features
- Separate numbers by your custom character separators like comma character (`,`) or any other characters.
- Does not accept non-numeric characters.
- Can work on any text inputs by your selector.### How to Use
1. Add **Easy Number Separator** plugin to your project:
```html
```
3. Make your input text field like this:
```html```
3. Select your input element:
```javascript
easyNumberSeparator({
selector: '.number-separator',
separator: ','
})
```### Options
|Title|Default|Description|
|-----|-------|-----------|
|selector|`.number-separator`|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|### Send data to server
If you want to send pure data to the server (without symbols), you can set a result input by `resultInput` property and hold the original value.#### Example:
##### HTML:
```html```
##### JavaScript:
```javascript
easyNumberSeparator({
selector: '.number-separator',
separator: ',',
resultInput: '#result_input',
})
```### CDN
```html```
Enjoy :)