mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
feat: Use Vue Filter for Amounts
This commit is contained in:
parent
034828a6f8
commit
09de529443
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="decayinformation-short">
|
||||
<span>− {{ decay ? $n(Number(decay.decay) * -1, 'decimal') : '' }}</span>
|
||||
<span v-if="decay.decay">{{ decay.decay | amount}}</span>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
<div class="text-right">
|
||||
<span class="gdd-transaction-list-item-operator">+</span>
|
||||
<span class="gdd-transaction-list-item-amount">
|
||||
{{ $n(amount, 'decimal') }}
|
||||
{{ amount | amount }}
|
||||
</span>
|
||||
</div>
|
||||
</b-col>
|
||||
|
||||
@ -23,9 +23,8 @@
|
||||
<b-row>
|
||||
<b-col cols="5">
|
||||
<div class="text-right">
|
||||
<span class="gdd-transaction-list-item-operator">−</span>
|
||||
<span class="gdd-transaction-list-item-amount">
|
||||
{{ $n(Number(amount) * -1, 'decimal') }}
|
||||
{{ amount | amount }}
|
||||
</span>
|
||||
</div>
|
||||
</b-col>
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
<div class="text-right">
|
||||
<span class="gdd-transaction-list-item-operator">+</span>
|
||||
<span class="gdd-transaction-list-item-amount">
|
||||
{{ $n(amount, 'decimal') }}
|
||||
{{ amount | amount }}
|
||||
</span>
|
||||
</div>
|
||||
</b-col>
|
||||
|
||||
@ -23,9 +23,8 @@
|
||||
<b-row>
|
||||
<b-col cols="5">
|
||||
<div class="text-right">
|
||||
<span class="gdd-transaction-list-item-operator">−</span>
|
||||
<span class="gdd-transaction-list-item-amount">
|
||||
{{ $n(Number(amount) * -1, 'decimal') }}
|
||||
{{ amount | amount }}
|
||||
</span>
|
||||
</div>
|
||||
</b-col>
|
||||
|
||||
6
frontend/src/filters/amount.js
Normal file
6
frontend/src/filters/amount.js
Normal file
@ -0,0 +1,6 @@
|
||||
import i18n from '@/i18n.js'
|
||||
|
||||
export const amount = (value) => {
|
||||
if (!value) return ''
|
||||
return i18n.n(value.toString(), 'decimal').replace('-', '− ')
|
||||
}
|
||||
@ -4,6 +4,7 @@ import App from './App.vue'
|
||||
import i18n from './i18n.js'
|
||||
import { loadAllRules } from './validation-rules'
|
||||
import { toasters } from './mixins/toaster'
|
||||
import { amount } from './filters/amount'
|
||||
|
||||
import 'regenerator-runtime'
|
||||
|
||||
@ -20,6 +21,7 @@ Vue.use(DashboardPlugin)
|
||||
Vue.config.productionTip = false
|
||||
|
||||
Vue.mixin(toasters)
|
||||
Vue.filter('amount', amount)
|
||||
|
||||
loadAllRules(i18n)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user