diff --git a/src/filters/index.js b/src/filters/index.js index bf1429aee..4360559d1 100644 --- a/src/filters/index.js +++ b/src/filters/index.js @@ -6,6 +6,7 @@ import toDateHourMinSec from './toDateHourMinSec'; import toRelativeDate from './toRelativeDate'; import toCurrency from './toCurrency'; import toPercentage from './toPercentage'; +import toNumber from './toNumber'; import toLowerCamel from './toLowerCamel'; import dashIfEmpty from './dashIfEmpty'; import dateRange from './dateRange'; @@ -34,6 +35,7 @@ export { toRelativeDate, toCurrency, toPercentage, + toNumber, dashIfEmpty, dateRange, getParamWhere, diff --git a/src/filters/toNumber.js b/src/filters/toNumber.js new file mode 100644 index 000000000..0fa892c1f --- /dev/null +++ b/src/filters/toNumber.js @@ -0,0 +1,8 @@ +export default function (value, fractionSize = 2) { + if (isNaN(value)) return value; + return new Intl.NumberFormat('es-ES', { + style: 'decimal', + minimumFractionDigits: 0, + maximumFractionDigits: fractionSize, + }).format(value); +} diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 3c1c80954..4729ca7fc 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -122,6 +122,7 @@ globals: producer: Producer origin: Origin state: State + total: Total subtotal: Subtotal visible: Visible price: Price diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 518985831..05a210036 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -126,6 +126,7 @@ globals: producer: Productor origin: Origen state: Estado + total: Total subtotal: Subtotal visible: Visible price: Precio diff --git a/src/pages/Supplier/Card/SupplierConsumption.vue b/src/pages/Supplier/Card/SupplierConsumption.vue index 8aa6d9174..26fa50c51 100644 --- a/src/pages/Supplier/Card/SupplierConsumption.vue +++ b/src/pages/Supplier/Card/SupplierConsumption.vue @@ -1,22 +1,20 @@ - - + + -