1.0.1 • Published 1 year ago

vue-num-locale-input v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

vue-num-locale-input

npm version Monthly Downloads MIT License

Vue 3 form input field component edited as numeric input field, displayed as language sensitive text field.

  • For language-sensitive representation of numbers see Number.prototype.toLocaleString()
  • Locale formatted number is displayed only if the field does not have focus. Otherwise it looks and behaves as normal numeric input field.
  • Especially useful for creating clear and easy to read tables containing numbers.

Samples

Bootstrap table, Czech locale, first field edited

Table, first item is edited

Bootstrap table, English locale, first field edited

Table, first item is edited

Installation

npm install vue-num-locale-input

Usage

<script>
import VueNumLocaleInput from "vue-num-locale-input";
</script>

<template>
  <VueNumLocaleInput
    v-model="yourNumericVariable"
    class="some-class"
    min="-10"
    max="10"
    step="2"
    :options="{minimumFractionDigits: 1, maximumFractionDigits: 1}"
  />
</template>

Important notes

  • Default locales is used (= browser settings). This version of the component does not allow to set it manually by props.
  • Property options is the same as documented in Intl.NumberFormat. Likely the most useful options are minimumFractionDigits and maximumFractionDigits, especially for tables.
  • You must not use html attribute type (e.g. type="number") on the component. It breaks its functionality.
1.0.1

1 year ago

1.0.0

1 year ago

0.9.5

1 year ago

0.9.4

1 year ago

0.9.3

1 year ago

0.9.2

1 year ago

0.9.1

1 year ago