<commit_before>finput
======

A vanilla-JS financial amount input control. Supports the following features -

* auto-formatting
* prevents invalid input whether typed, dragged or pasted
* 'k', 'm', 'b', etc. multiplier keys

Usage
-----
See an example finput [here](http://scottlogic.github.io/finput)

#### Install package
`npm install finput`

#### Initialise input
To initialise the finput, simply pass the element and any options into the finput constructor.  
The function returned is the cleanup function which removes all the added finput listeners from the input,
making it act like the default browser input once again.

```javascript
var destroy = finput(element, options);
destroy();  // Stops finput behaviour
```

Options
-----

##### scale
Type: `Number`  
Default: `2`

Maximum number of decimal digits the value can take

##### range
Type: `Number`  
Default: `ALL`

The possible range of values that the value can take

Possible Values:  
- `'ALL'`: Number can take any value  
- `'POSITIVE'`: Number can only be positive

##### fixed
Type: `Boolean`  
Default: `true`  
If true, after focus is lost value is formatted to *scale* number of decimal places

##### thousands
Type: `string`  <commit_msg>Update readme to show babel-polyfill requirement<commit_after>finput
======

A vanilla-JS financial amount input control. Supports the following features -

* auto-formatting
* prevents invalid input whether typed, dragged or pasted
* 'k', 'm', 'b', etc. multiplier keys

Usage
-----
See an example finput [here](http://scottlogic.github.io/finput)

#### Install package
`npm install finput`

#### Initialise input
To initialise the finput, simply pass the element and any options into the finput constructor.  
The function returned is the cleanup function which removes all the added finput listeners from the input,
making it act like the default browser input once again.

```javascript
var destroy = finput(element, options);
destroy();  // Stops finput behaviour
```

#### IE11
To function correctly with IE11 you will need to include `babel-polyfill` in your project

Options
-----

##### scale
Type: `Number`  
Default: `2`

Maximum number of decimal digits the value can take

##### range
Type: `Number`  
Default: `ALL`

The possible range of values that the value can take

Possible Values:  
- `'ALL'`: Number can take any value  
- `'POSITIVE'`: Number can only be positive

##### fixed
Type: `Boolean`  
Default: `true`  
If true, after focus is lost value is formatted to *scale* number of decimal places

##### thousands
Type: `string`  
{'fraction_non_alphanumeric': 0.10739299610894941, 'fraction_numerical': 0.0023346303501945525, 'mean_word_length': 4.2792607802874745, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6732901', 'n_tokens_mistral': 744, 'n_tokens_neox': 702, 'n_words': 334}