Input Number

A web component, which enhance the input wth formating feature based on the locale provided. or the browsers locale.

Formating is done based on Internationalization standards

Installation#

NPM module#

npm install @i18n-components/input-number

CDN#

<script src="https://unpkg.com/@i18n-components/input-number@latest/dist/index.js"></script>

Usage#

// Import IIFE
import '@i18n-components/input-number';
//Use in your HTML/React component/Angular Component/Vue Component
<input type="tel" is="i18n-input-number" locale='fr-FR' decimalDigits='4'/>

See Section for Detailed Examples

API#

This Supports all the attributes supported by standard HTMLInputElement.

There are few custom attributes also supported.

AttriubutesTypeDefault
localeStringBrowser's Locale navigator.language
decimalDigitsString2

Examples#

Vanilla Javascript example#