Cents Input
Handle money with cents input when it must start filling from decimal part.
Example:
How to use it
First, install cents-input
package:
npm i cents-input
Then import it in your project:
;
Create an instance of the CentsInput class:
const instance = ;
Options
You can set a prefix and separator as options:
const instance = prefix: 'R$ ' // default is empty separator: '.' // default is comma;
Methods
There are some methods available:
instance;
Add a digit to the current value. Put the value you want to add as a parameter.
instance;
Remove a digit from the end of the current value.
instance;
Return the formatted value, including the prefix.
instance;
Return the float value, without the prefix.
instance;
Reset the value.