Browse Source

fix(nc-gui): revise currency computed logic

pull/5614/head
Wing-Kam Wong 2 years ago
parent
commit
ca1b28b714
  1. 7
      packages/nc-gui/components/cell/Currency.vue

7
packages/nc-gui/components/cell/Currency.vue

@ -41,9 +41,10 @@ const currencyMeta = computed(() => {
const currency = computed(() => {
try {
return !vModel.value || isNaN(vModel.value)
? vModel.value
: new Intl.NumberFormat(currencyMeta.value.currency_locale || 'en-US', {
if (vModel.value === null || vModel.value === undefined || isNaN(vModel.value)) {
return vModel.value
}
return new Intl.NumberFormat(currencyMeta.value.currency_locale || 'en-US', {
style: 'currency',
currency: currencyMeta.value.currency_code || 'USD',
}).format(vModel.value)

Loading…
Cancel
Save