add coma filter for saham & yuran
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
<li class="list-group-item"><b>No. Kad Pengenalan : </b>{{ data.user.no_kp }}</li>
|
||||
<li class="list-group-item"><b>No. Anggota : </b>{{ data.user.no_anggota }}
|
||||
<li class="list-group-item"><b>Unit : </b>{{ data.user.unit }}</li>
|
||||
<li class="list-group-item"><b>Saham : </b>{{ data.user.saham }}</li>
|
||||
<li class="list-group-item"><b>Yuran : </b>{{ data.user.yuran }}</li>
|
||||
<li class="list-group-item"><b>Saham :</b> RM {{ data.user.saham | formatNumberWithCommas() }}</li>
|
||||
<li class="list-group-item"><b>Yuran :</b> RM {{ data.user.yuran | formatNumberWithCommas() }}</li>
|
||||
<li class="list-group-item" v-if="data.election.status == 1">
|
||||
<center>Undian belum bermula</center>
|
||||
</li>
|
||||
@@ -108,6 +108,11 @@
|
||||
<script>
|
||||
import { R } from '@bachdgvn/vue-otp-input';
|
||||
|
||||
Vue.filter('formatNumberWithCommas', function (value) {
|
||||
if (!value) return '';
|
||||
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
});
|
||||
|
||||
export default {
|
||||
created: function () {
|
||||
//console.log(this)
|
||||
@@ -121,6 +126,13 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
filters: {
|
||||
formatNumberWithCommas: function (value) {
|
||||
if (!value) return '';
|
||||
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
hasVoted: function () {
|
||||
return this.data.result.length > 0;
|
||||
@@ -161,7 +173,9 @@ export default {
|
||||
this.nomineeViewed = {...nominee};
|
||||
this.nomineeViewed.photo = this.createBase64ImageUrl(nominee.photo);
|
||||
$('#view-nominee-modal').modal();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user