1.0.3 • Published 4 years ago

vue-number-formating-2 v1.0.3

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

VueNumberFormating

vue convert number to decimal formating

install

> npm install --save vue-number-formating-2
> yarn add vue-number-formating-2

config

1 ) create file plugin/VueNumberFormating.js

 import Vue from 'vue'
 import VueNumberFormating from 'vue-number-formating-2'

 Vue.use(VueNumberFormating);
 

2 ) import To main.js

    import Vue from 'vue'
    import App from './App.vue'
    import './plugin/VueNumberFormating'
        
    new Vue({
      el: '#app',
      render: h => h(App),
    }); 

use

    <template>
        <p>{{ $nF.numberToFormat(1500000) }}</p>
        <span> Convert In 1,500,000 </span>
    </template>
    
    // OR
    
    <script>
        export default {
            mounted() {
                this.$nF.numberToFormat(1500000); // conevrt to 1,500,000
            }
        }
    </script>
    

remove comma :

this.$nF.removeCommasAmount('1,500,000'); // conevrt to 1500000