All Projects → kevinongko → Vue Numeric

kevinongko / Vue Numeric

Licence: mit
Input field component to display a formatted currency value based on Vue.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Numeric

react-numeric
A react component for formatted number form fields
Stars: ✭ 30 (-91.2%)
Mutual labels:  money, input, currency
CurrencyEditText
A simple EditText input designed to input decimal and currency values.
Stars: ✭ 18 (-94.72%)
Mutual labels:  money, input, currency
Cashify
💸 Lightweight currency conversion library, successor of money.js
Stars: ✭ 329 (-3.52%)
Mutual labels:  currency, money
v-currency
A plugin for formatting currency for different countries in Vue
Stars: ✭ 24 (-92.96%)
Mutual labels:  currency, vue2
Narvalo.NET
Applied functional patterns for C#. Money and Currency types. MVP framework. (Obsolete)
Stars: ✭ 16 (-95.31%)
Mutual labels:  money, currency
Guide-to-Swift-Numbers-Sample-Code
Xcode Playground Sample Code for the Flight School Guide to Swift Numbers
Stars: ✭ 92 (-73.02%)
Mutual labels:  money, currency
money-parser
Price and currency parsing utility
Stars: ✭ 26 (-92.38%)
Mutual labels:  money, currency
money
Crystal shard for dealing with money and currency conversion
Stars: ✭ 26 (-92.38%)
Mutual labels:  money, currency
vue-input-streaming
A Vue2 Input Streaming RealTime And Two Way Data Binding Broadcasting with Pusher
Stars: ✭ 24 (-92.96%)
Mutual labels:  input, vue2
currency-converter
💰 Easily convert between 32 currencies
Stars: ✭ 16 (-95.31%)
Mutual labels:  money, currency
swift-currency
Type-safety and algorithms for working with money in Swift.
Stars: ✭ 88 (-74.19%)
Mutual labels:  money, currency
django-prices-openexchangerates
openexchangerates.org support for django-prices
Stars: ✭ 33 (-90.32%)
Mutual labels:  money, currency
stockholm
💵 Modern Python library for working with money and monetary amounts. Human friendly and flexible approach for development. 100% test coverage + built-in support for GraphQL and Protocol Buffers transports using current best-practices.
Stars: ✭ 26 (-92.38%)
Mutual labels:  money, currency
LEAmountInputView
Amount Input View (inspired by Square's design)
Stars: ✭ 44 (-87.1%)
Mutual labels:  input, currency
pesa
A JS money lib whose precision goes up to 11 (and beyond).
Stars: ✭ 38 (-88.86%)
Mutual labels:  money, currency
vue-number-keyboard
vue-number-keyboard是基于VUE实现的数字键盘插件,当前支持整数、小数数字输入、乱序键盘,demo中给出了常用的验证码、金额数字示例。数字键盘的大小包括字体尺寸支持响应式。
Stars: ✭ 51 (-85.04%)
Mutual labels:  money, vue2
Laravel Money
Currency formatting and conversion package for Laravel
Stars: ✭ 261 (-23.46%)
Mutual labels:  currency, money
binarium
Binarium cryptocurrency is the first one protected from ASICs
Stars: ✭ 14 (-95.89%)
Mutual labels:  money, currency
vue-input-autowidth
A Vue.js directive that automatically resizes an input's width to fit its contents.
Stars: ✭ 94 (-72.43%)
Mutual labels:  input, vue2
FinanceKit
FinanceKit is a Framework for iOS and Mac to build apps working with financial data, like money, currencies, stocks, portfolio, transactions and other concepts.
Stars: ✭ 15 (-95.6%)
Mutual labels:  money, currency

vue-numeric

npm npm npm Build Status Codecov npm

Input field component to display a formatted currency value based on Vue.

Live Demo

Works with Vue 2.*

Installation

Install via CDN

<script src="https://unpkg.com/accounting-js"></script>
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vue-numeric"></script>

<script>
  Vue.use(VueNumeric.default)
</script>

Install via NPM

$ npm install vue-numeric --save

Register as Component

import Vue from 'vue'
import VueNumeric from 'vue-numeric'

export default {
  name: 'App',

  components: {
    VueNumeric
  }
}

Register as Plugin

import Vue from 'vue'
import VueNumeric from 'vue-numeric'

Vue.use(VueNumeric)

Usage

screen shot 2016-12-08 at 2 19 31 pm

Quick example

<template>
  <vue-numeric currency="$" separator="," v-model="price"></vue-numeric>
</template>

<script>
import VueNumeric from 'vue-numeric'

export default {
  name: 'App',

  components: {
    VueNumeric
  },

  data: () => ({
    price: ''
  }),
}
</script>

Currency symbol

Set the currency prop to add a currency symbol within the input.

<vue-numeric currency="$"></vue-numeric>

Minimum & maximum constraint

Limit the minimum and maximum value by using min and max props.

  • min defaults to 0.
  • min and max accept String or Number values.
<vue-numeric v-bind:min="2000" v-bind:max="10000"></vue-numeric>

Disable/enable negative values

minus defaults to false (no negative numbers).

<vue-numeric v-bind:minus="false"></vue-numeric>

Enable decimal precision

By default the decimal value is disabled. To use decimals in the value, add the precision prop.

  • precision accept a String or Number numeric value.
<vue-numeric v-bind:precision="2"></vue-numeric>

Thousands separator

  • Default thousand separator's symbol is ,.
  • Use the separator prop to change the thousands separator.
  • separator only accepts space, , or ..
  • When using the . or space as thousand separator, the decimal separator will be ,.
<vue-numeric separator="."></vue-numeric>

Input placeholder when empty

<vue-numeric placeholder="only number allowed"></vue-numeric>

Value when empty

By default, when you clean the input the value is set to 0. You can change this value to fit your needs.

<vue-numeric :empty-value="1"></vue-numeric>

Output Type

By default the value emitted for the input event is of type Number. However you may choose to get a String instead by setting the property output-type to String.

<vue-numeric output-type="String"></vue-numeric>

Props

Props Description Required Type Default
currency Currency prefix false String -
currency-symbol-position Position of the symbol (accepted values: prefix or suffix) false String prefix
max Maximum value allowed false Number 9007199254740991
min Minimum value allowed false Number -9007199254740991
minus Enable/disable negative values false Boolean false
placeholder Input placeholder false String -
empty-value Value when input is empty false Number 0
output-type Output Type for input event false String String
precision Number of decimals false Number -
separator Thousand separator symbol (accepts space, . or ,) false String ,
decimal-separator Custom decimal separator false String -
thousand-separator Custom thousand separator false String -
read-only Hide input field and show the value as text false Boolean false
read-only-class Class for read-only element false String ''

License

Vue-Numeric is open-sourced software licensed under the MIT license

Support

Hello, I'm Kevin the maintainer of this project in my free time (which is getting lessen these days), if this project does help you in any way please consider to support me. Thanks 😃

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].