From 72551a440ef6c574d612a0d5797aa413f8eb94ad Mon Sep 17 00:00:00 2001 From: mertmit Date: Sat, 4 Jun 2022 10:54:06 +0300 Subject: [PATCH] fix: pg database type money Signed-off-by: mertmit --- .../components/cell/CurrencyCell.vue | 7 +- .../components/editColumn/CurrencyOptions.vue | 77 ++++++++++++------- 2 files changed, 54 insertions(+), 30 deletions(-) diff --git a/packages/nc-gui/components/project/spreadsheet/components/cell/CurrencyCell.vue b/packages/nc-gui/components/project/spreadsheet/components/cell/CurrencyCell.vue index c60ae4e2b3..d8e1321d40 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/cell/CurrencyCell.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/cell/CurrencyCell.vue @@ -13,8 +13,11 @@ export default { computed: { currency() { try { - return new Intl.NumberFormat(this.currencyMeta.currency_locale || 'en-US', - { style: 'currency', currency: this.currencyMeta.currency_code || 'USD' }).format(this.value) + return isNaN(this.value) + ? this.value + : new Intl.NumberFormat(this.currencyMeta.currency_locale || 'en-US', + { style: 'currency', currency: this.currencyMeta.currency_code || 'USD' }) + .format(this.value) } catch (e) { return this.value } diff --git a/packages/nc-gui/components/project/spreadsheet/components/editColumn/CurrencyOptions.vue b/packages/nc-gui/components/project/spreadsheet/components/editColumn/CurrencyOptions.vue index fbfa1d1bff..a18ecf6a4e 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/editColumn/CurrencyOptions.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/editColumn/CurrencyOptions.vue @@ -1,32 +1,39 @@