diff --git a/docs/.vitepress/theme/components/Demo.vue b/docs/.vitepress/theme/components/Demo.vue index 019dc10..c924720 100644 --- a/docs/.vitepress/theme/components/Demo.vue +++ b/docs/.vitepress/theme/components/Demo.vue @@ -256,10 +256,28 @@ export default defineComponent({ value: 1234.5, localeEnabled: false, locale: 'de-DE', - locales: ['de-DE', 'de-CH', 'en-US', 'en-IN', 'nl-NL', 'sv-SE', 'fr-FR', 'es-ES', 'pt-PT', 'pt-BR', 'zh-ZH', 'ja-JP', 'ar-SA', 'fa-IR', 'bg-BG'], + locales: [ + 'ar-SA', + 'bg-BG', + 'cs-CZ', + 'de-CH', + 'de-DE', + 'en-IN', + 'en-US', + 'es-ES', + 'fa-IR', + 'fr-FR', + 'ja-JP', + 'nl-NL', + 'pl-PL', + 'pt-BR', + 'pt-PT', + 'sv-SE', + 'zh-ZH' + ], currency: 'EUR', currencyDisplay: 'symbol', - currencies: ['EUR', 'USD', 'JPY', 'GBP', 'BRL', 'INR', 'CNY', 'JPY', 'SAR', 'IRR', 'BGN'], + currencies: ['EUR', 'USD', 'BGN', 'BRL', 'CNY', 'CZK', 'GBP', 'INR', 'IRR', 'JPY', 'PLN', 'SAR'], currencyDisplays: [ { value: 'symbol', label: 'Symbol' }, { value: 'narrowSymbol', label: 'Narrow symbol' }, @@ -281,11 +299,11 @@ export default defineComponent({ hideNegligibleDecimalDigitsOnFocus: true, precisionEnabled: false, precisionRangeEnabled: false, - precisionRangeMinValue: 2, + precisionRangeMinValue: 1, precisionRangeMaxValue: 5, precision: 2, - precisionOptions: computed(() => range(1, 16)), - precisionRangeMinOptions: computed(() => range(1, state.precisionRangeMaxValue + 1)), + precisionOptions: computed(() => range(0, 16)), + precisionRangeMinOptions: computed(() => range(0, state.precisionRangeMaxValue + 1)), precisionRangeMaxOptions: computed(() => range(state.precisionRangeMinValue, 16)), valueRangeEnabled: false, minValue: undefined, diff --git a/tests/unit/currencyFormat.spec.ts b/tests/unit/currencyFormat.spec.ts index da369f1..3bf5c2c 100644 --- a/tests/unit/currencyFormat.spec.ts +++ b/tests/unit/currencyFormat.spec.ts @@ -84,6 +84,7 @@ describe('CurrencyFormat', () => { expect(new CurrencyFormat({ locale: 'de-AT', currency: 'EUR' }).parse('€ 66.668')).toBe(66668) expect(new CurrencyFormat({ locale: 'de-DE', currency: 'USD', currencyDisplay: CurrencyDisplay.name }).parse('1.234,50 US-Dollar')).toBe(1234.5) expect(new CurrencyFormat({ locale: 'en', currency: 'USD', accountingSign: true }).parse('(1,234.50)')).toBe(-1234.5) + expect(new CurrencyFormat({ locale: 'pl-PL', currency: 'PLN' }).parse('1234,50 zł')).toBe(-1234.5) }) it('should return null if the value does not conform to the currency format', () => {