vue-currency-input
Advanced tools
Comparing version 1.18.0 to 1.18.1
/** | ||
* Vue Currency Input 1.18.0 | ||
* Vue Currency Input 1.18.1 | ||
* (c) 2020 Matthias Stiller | ||
@@ -114,5 +114,2 @@ * @license MIT | ||
str = normalizeDigits(str, currencyFormat.digits); | ||
if (isNumber(str)) { | ||
return toInteger(Number(str), valueAsInteger, currencyFormat.minimumFractionDigits) | ||
} | ||
var value = stripCurrencySymbol(str, currencyFormat); | ||
@@ -545,5 +542,11 @@ var numberParts = value.split(currencyFormat.decimalSymbol); | ||
return { | ||
formattedValue: this.value | ||
formattedValue: null | ||
} | ||
}, | ||
created: function created () { | ||
var ref = createCurrencyFormat(this.options); | ||
var minimumFractionDigits = ref.minimumFractionDigits; | ||
var maximumFractionDigits = ref.maximumFractionDigits; | ||
this.formattedValue = this.value != null ? this.value.toLocaleString(this.locale, { minimumFractionDigits: minimumFractionDigits, maximumFractionDigits: maximumFractionDigits }) : null; | ||
}, | ||
computed: { | ||
@@ -550,0 +553,0 @@ options: function options () { |
/** | ||
* Vue Currency Input 1.18.0 | ||
* Vue Currency Input 1.18.1 | ||
* (c) 2020 Matthias Stiller | ||
@@ -120,5 +120,2 @@ * @license MIT | ||
str = normalizeDigits(str, currencyFormat.digits); | ||
if (isNumber(str)) { | ||
return toInteger(Number(str), valueAsInteger, currencyFormat.minimumFractionDigits) | ||
} | ||
var value = stripCurrencySymbol(str, currencyFormat); | ||
@@ -551,5 +548,11 @@ var numberParts = value.split(currencyFormat.decimalSymbol); | ||
return { | ||
formattedValue: this.value | ||
formattedValue: null | ||
} | ||
}, | ||
created: function created () { | ||
var ref = createCurrencyFormat(this.options); | ||
var minimumFractionDigits = ref.minimumFractionDigits; | ||
var maximumFractionDigits = ref.maximumFractionDigits; | ||
this.formattedValue = this.value != null ? this.value.toLocaleString(this.locale, { minimumFractionDigits: minimumFractionDigits, maximumFractionDigits: maximumFractionDigits }) : null; | ||
}, | ||
computed: { | ||
@@ -556,0 +559,0 @@ options: function options () { |
{ | ||
"name": "vue-currency-input", | ||
"description": "Easy input of currency formatted numbers for Vue.js.", | ||
"version": "1.18.0", | ||
"version": "1.18.1", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "unpkg": "dist/vue-currency-input.umd.js", |
import { DEFAULT_OPTIONS, setValue } from './api' | ||
import currencyDirective from './directive' | ||
import createCurrencyFormat from './utils/createCurrencyFormat' | ||
@@ -75,5 +76,9 @@ export default { | ||
return { | ||
formattedValue: this.value | ||
formattedValue: null | ||
} | ||
}, | ||
created () { | ||
const { minimumFractionDigits, maximumFractionDigits } = createCurrencyFormat(this.options) | ||
this.formattedValue = this.value != null ? this.value.toLocaleString(this.locale, { minimumFractionDigits, maximumFractionDigits }) : null | ||
}, | ||
computed: { | ||
@@ -80,0 +85,0 @@ options () { |
@@ -7,5 +7,2 @@ import { toInteger } from './numberUtils' | ||
str = normalizeDigits(str, currencyFormat.digits) | ||
if (isNumber(str)) { | ||
return toInteger(Number(str), valueAsInteger, currencyFormat.minimumFractionDigits) | ||
} | ||
let value = stripCurrencySymbol(str, currencyFormat) | ||
@@ -12,0 +9,0 @@ const numberParts = value.split(currencyFormat.decimalSymbol) |
79002
1771