Skip to content

Commit

Permalink
2.2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinongko committed Jan 10, 2018
1 parent e0178ca commit f3f88db
Show file tree
Hide file tree
Showing 5 changed files with 218 additions and 235 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ By default, when you clean the input the value is set to `0`. You can change thi
|empty-value|Value when input is empty|false|Number|0|
|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|''|

Expand Down
2 changes: 1 addition & 1 deletion dist/vue-numeric.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-numeric",
"version": "2.2.8",
"version": "2.2.9",
"description": "Input field component to display currency value based on Vue.",
"author": "Kevin Ongko",
"main": "dist/vue-numeric.min.js",
Expand Down
12 changes: 6 additions & 6 deletions src/vue-numeric.vue
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export default {
* Define decimal separator based on separator props.
* @return {String} '.' or ','
*/
$decimalSeparator () {
decimalSeparatorSymbol () {
if (typeof this.decimalSeparator !== 'undefined') return this.decimalSeparator
if (this.separator === ',') return '.'
return ','
Expand All @@ -189,7 +189,7 @@ export default {
* Define thousand separator based on separator props.
* @return {String} '.' or ','
*/
$thousandSeparator () {
thousandSeparatorSymbol () {
if (typeof this.thousandSeparator !== 'undefined') return this.thousandSeparator
if (this.separator === '.') return '.'
if (this.separator === 'space') return ' '
Expand Down Expand Up @@ -295,7 +295,7 @@ export default {
symbol: '',
format: '%v',
thousand: '',
decimal: this.$decimalSeparator,
decimal: this.decimalSeparatorSymbol,
precision: Number(this.precision)
})
}
Expand Down Expand Up @@ -337,8 +337,8 @@ export default {
symbol: this.currency,
format: this.symbolPosition,
precision: Number(this.precision),
decimal: this.$decimalSeparator,
thousand: this.$thousandSeparator
decimal: this.decimalSeparatorSymbol,
thousand: this.thousandSeparatorSymbol
})
},
Expand All @@ -349,7 +349,7 @@ export default {
*/
unformat (value) {
const toUnformat = typeof value === 'string' && value === '' ? this.emptyValue : value
return accounting.unformat(toUnformat, this.$decimalSeparator)
return accounting.unformat(toUnformat, this.decimalSeparatorSymbol)
}
}
}
Expand Down
Loading

0 comments on commit f3f88db

Please sign in to comment.