@penguin3007/currency-input
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

Currency Input

Currency Input allows an easy input of currency formatted numbers based on the ECMAScript Internationalization API ( Intl.NumberFormat).

Built on Vue Currency Input and TypeScript

Guide

To use Currency Input just import component
import { Index } from '../dist/currencyInput.min.js';

Init class

const inputEl = document.getElementById('currency-input')

const currencyInput = new Index(inputEl, {
    options: {
      locale: 'de-DE', //BCP 47 language tag
      currency: 'EUR' //ISO 4217 currency code
    }
  });

Functions

getValue()

To get value from Currency Input use method
currencyInput.getValue() it returns Object

{
    "number": 300,
    "formatted": "300 €"
}

setValue(value)
To set value use method
currencyInput.setValue(value)

Options

List of options you can find here Options

Package Sidebar

Install

npm i @penguin3007/currency-input

Weekly Downloads

0

Version

1.0.6

License

ISC

Unpacked Size

53.3 kB

Total Files

17

Last publish

Collaborators

  • penguin3007