@@ -96,6 +96,26 @@ export default {
96
96
required: false
97
97
},
98
98
99
+ /**
100
+ * Forced thousand separator.
101
+ * Accepts any string.
102
+ */
103
+ thousandSeparator: {
104
+ default: undefined ,
105
+ required: false ,
106
+ type: String
107
+ },
108
+
109
+ /**
110
+ * Forced decimal separator.
111
+ * Accepts any string.
112
+ */
113
+ decimalSeparator: {
114
+ default: undefined ,
115
+ required: false ,
116
+ type: String
117
+ },
118
+
99
119
/**
100
120
* v-model value.
101
121
*/
@@ -159,7 +179,8 @@ export default {
159
179
* Define decimal separator based on separator props.
160
180
* @return {String} '.' or ','
161
181
*/
162
- decimalSeparator () {
182
+ $decimalSeparator () {
183
+ if (typeof this .decimalSeparator !== ' undefined' ) return this .decimalSeparator
163
184
if (this .separator === ' ,' ) return ' .'
164
185
return ' ,'
165
186
},
@@ -168,7 +189,8 @@ export default {
168
189
* Define thousand separator based on separator props.
169
190
* @return {String} '.' or ','
170
191
*/
171
- thousandSeparator () {
192
+ $thousandSeparator () {
193
+ if (typeof this .thousandSeparator !== ' undefined' ) return this .thousandSeparator
172
194
if (this .separator === ' .' ) return ' .'
173
195
if (this .separator === ' space' ) return ' '
174
196
return ' ,'
@@ -273,7 +295,7 @@ export default {
273
295
symbol: ' ' ,
274
296
format: ' %v' ,
275
297
thousand: ' ' ,
276
- decimal: this .decimalSeparator ,
298
+ decimal: this .$ decimalSeparator ,
277
299
precision: Number (this .precision )
278
300
})
279
301
}
@@ -315,8 +337,8 @@ export default {
315
337
symbol: this .currency ,
316
338
format: this .symbolPosition ,
317
339
precision: Number (this .precision ),
318
- decimal: this .decimalSeparator ,
319
- thousand: this .thousandSeparator
340
+ decimal: this .$ decimalSeparator ,
341
+ thousand: this .$ thousandSeparator
320
342
})
321
343
},
322
344
@@ -327,7 +349,7 @@ export default {
327
349
*/
328
350
unformat (value ) {
329
351
const toUnformat = typeof value === ' string' && value === ' ' ? this .emptyValue : value
330
- return accounting .unformat (toUnformat, this .decimalSeparator )
352
+ return accounting .unformat (toUnformat, this .$ decimalSeparator )
331
353
}
332
354
}
333
355
}
0 commit comments