An open API service indexing awesome lists of open source software.

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

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 :)