vue-number-formating-2

1.0.3 • Public • Published

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

Package Sidebar

Install

npm i vue-number-formating-2

Weekly Downloads

2

Version

1.0.3

License

ISC

Unpacked Size

5.46 kB

Total Files

7

Last publish

Collaborators

  • mehrdadsalimy