Socket
Socket
Sign inDemoInstall

vue-numerals

Package Overview
Dependencies
22
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-numerals

Use Numeral.js as a Vue filter to formatting numbers.


Version published
Weekly downloads
1.1K
increased by0.92%
Maintainers
1
Install size
85.1 kB
Created
Weekly downloads
 

Readme

Source

vue-numerals

Node CI Release

Use the power of Numerals.js to properly format numbers inside your Vue components!

Requirements

Installation

In the browser

<!-- Import Numeral.js (http://numeraljs.com/#use-it) -->
<script src="//cdnjs.cloudflare.com/ajax/libs/numeral.js/2.0.0/numeral.min.js"></script>
<!-- Then import vue-numerals -->
<script src="https://unpkg.com/vue-numerals/dist/vue-numerals.min.js"></script>

With Node.js

$ yarn add vue-numerals 'numeral@>=2'
import { createApp } from 'vue';
import VueNumerals from 'vue-numerals';
import App from './App.vue'

const app = createApp(App);

app.use(VueNumerals); // default locale is 'en'

// with options
app.use(VueNumerals, {
  locale: 'fr'
});

app.mount('#app');

Usage

Inside your component:

<template>
  <div>
    <!-- Will display: `12,345` -->
    <p>{{ numeralFormat(count) }}</p>
    
    <!-- Will display: `12,345 $` --> 
    <p>{{ numeralFormat(count, '0,0[.]00 $') }}</p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      count: 12345,
    };
  },
}
</script>

License

MIT

FAQs

Last updated on 23 Feb 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc