I would write method for that, and then where you need to format number you can just put method in template and pass value down
methods: {
formatNumber(value) {
let val = (value/1).toFixed(2).replace(',', '.')
return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
},
}
And then in template:
<template>
<div>
<div class="panel-group"v-for="(value,index) in list">
<div class="col-md-8">
<small>
Total: <b>{{formatNumber (value.total) }}</b>
</small>
</div>
</div>
</div>
</template>
Subscribe to:
Post Comments (Atom)
Ajax load lage with laravel.
step-1: HTML <div class="row"> <div class="col-lg-12"> <d...
-
<div id="employeement_more"> <div class="row employeementAppendDiv" style="border-top: 1px dotted #d...
-
Step:01 #To install through Composer, by run the following command: composer require nwidart/laravel-modules php artisan vendor:publish...
-
Vue JS - Bootstrap Datepicker HTML <div class="m-form__group m-form__group"> <label class="m-label m-label-...
No comments:
Post a Comment