Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
vue-filter-number-format
Advanced tools
Readme
Vue.js filter for formatting numbers
This is a simple wrapper for Numeral.js.
This package requires you to install Numeral.js as a peer dependency (numeral@^2
). This way, you can use a different version of Numeral, or even a drop-in replacement with the same API.
Use version 1 of this package if you want it to install its own Numeral.js dependency as part of the bundle.
Pass in Numeral to create the formatter function, and register globally as a Vue filter in your main.js-ish file:
import numeral from 'numeral';
import numFormat from 'vue-filter-number-format';
Vue.filter('numFormat', numFormat(numeral));
// new Vue ...
Use anywhere in your .vue files:
// default format is '0,0'
{{ 69696969 | numFormat }} -> "69,696,969"
// use a custom format string
{{ 420 | numFormat('0.000') }} -> "420.000"
{{ 666 | numFormat('0,0o') }} -> "666th"
See the Numeral.js docs for other formatting options.
For convenience, this function is bundled with a VueJS dev site.
# install dependencies
yarn
# serve example app with hot reload at localhost:8080
yarn run dev
# build for production with minification
yarn run build
MIT
FAQs
Vue.js filter for formatting numbers
We found that vue-filter-number-format demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).