@@ -96,6 +96,26 @@ export default {
9696 required: false
9797 },
9898
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+
99119 /**
100120 * v-model value.
101121 */
@@ -159,7 +179,8 @@ export default {
159179 * Define decimal separator based on separator props.
160180 * @return {String} '.' or ','
161181 */
162- decimalSeparator () {
182+ $decimalSeparator () {
183+ if (typeof this .decimalSeparator !== ' undefined' ) return this .decimalSeparator
163184 if (this .separator === ' ,' ) return ' .'
164185 return ' ,'
165186 },
@@ -168,7 +189,8 @@ export default {
168189 * Define thousand separator based on separator props.
169190 * @return {String} '.' or ','
170191 */
171- thousandSeparator () {
192+ $thousandSeparator () {
193+ if (typeof this .thousandSeparator !== ' undefined' ) return this .thousandSeparator
172194 if (this .separator === ' .' ) return ' .'
173195 if (this .separator === ' space' ) return ' '
174196 return ' ,'
@@ -273,7 +295,7 @@ export default {
273295 symbol: ' ' ,
274296 format: ' %v' ,
275297 thousand: ' ' ,
276- decimal: this .decimalSeparator ,
298+ decimal: this .$ decimalSeparator ,
277299 precision: Number (this .precision )
278300 })
279301 }
@@ -315,8 +337,8 @@ export default {
315337 symbol: this .currency ,
316338 format: this .symbolPosition ,
317339 precision: Number (this .precision ),
318- decimal: this .decimalSeparator ,
319- thousand: this .thousandSeparator
340+ decimal: this .$ decimalSeparator ,
341+ thousand: this .$ thousandSeparator
320342 })
321343 },
322344
@@ -327,7 +349,7 @@ export default {
327349 */
328350 unformat (value ) {
329351 const toUnformat = typeof value === ' string' && value === ' ' ? this .emptyValue : value
330- return accounting .unformat (toUnformat, this .decimalSeparator )
352+ return accounting .unformat (toUnformat, this .$ decimalSeparator )
331353 }
332354 }
333355}
0 commit comments