All Projects β†’ lloydjatkinson β†’ Vue Numeral Filter

lloydjatkinson / Vue Numeral Filter

Licence: mit
Vue.js filter for Numeral.js πŸ”’ πŸ”£

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Numeral Filter

jooger.me
πŸ‘ My personal website,powered by @nuxt
Stars: ✭ 39 (-46.58%)
Mutual labels:  vuejs2, vue-component
Vue Video Player
🎞 @videojs component for @vuejs
Stars: ✭ 4,026 (+5415.07%)
Mutual labels:  vue-component, vuejs2
vue-notification-bell
Vue.js notification bell component.
Stars: ✭ 64 (-12.33%)
Mutual labels:  vuejs2, vue-component
Vue Codemirror
⌨️ @codemirror component for @vuejs
Stars: ✭ 2,115 (+2797.26%)
Mutual labels:  vue-component, vuejs2
Vue Quill Editor
🍑@quilljs editor component for @vuejs
Stars: ✭ 6,874 (+9316.44%)
Mutual labels:  vue-component, vuejs2
Vue Marquee Text Component
[CSS GPU Animation] Marquee Text for vuejs
Stars: ✭ 226 (+209.59%)
Mutual labels:  vue-component, vuejs2
Quasar
Quasar Framework - Build high-performance VueJS user interfaces in record time
Stars: ✭ 20,090 (+27420.55%)
Mutual labels:  vue-component, vuejs2
Xcui
🍴 A Vue.js 2.x desktop components colletion
Stars: ✭ 88 (+20.55%)
Mutual labels:  vue-component, vuejs2
Vue Star Rating
⭐️ A simple, highly customisable star rating component for Vue 2.x. / 3.x
Stars: ✭ 509 (+597.26%)
Mutual labels:  vue-component, vuejs2
Vue2 Calendar
vue 2.x calendar component
Stars: ✭ 477 (+553.42%)
Mutual labels:  vue-component, vuejs2
Vue Awesome Swiper
πŸ† Swiper component for @vuejs
Stars: ✭ 12,072 (+16436.99%)
Mutual labels:  vue-component, vuejs2
Navscroll Js
Lightweight package for highlighting menu items as you scroll the page, also scrolling to target section when item clicked. Use as a vue component/directive or in vanilla js.
Stars: ✭ 41 (-43.84%)
Mutual labels:  vue-component, vuejs2
Vue Gmaps
Search places and address using Google Maps API
Stars: ✭ 108 (+47.95%)
Mutual labels:  vue-component, vuejs2
Vue Form Json Schema
Create forms using JSON schema. Bring your components!
Stars: ✭ 253 (+246.58%)
Mutual labels:  vue-component, vuejs2
Vue Toastr
Vuejs Toast : Plugin and Component Capability.
Stars: ✭ 93 (+27.4%)
Mutual labels:  vue-component, vuejs2
vue-popover
Reusable popover component for Vue
Stars: ✭ 22 (-69.86%)
Mutual labels:  vuejs2, vue-component
Vue Particles
Vue.js component for particles backgrounds ✨
Stars: ✭ 1,220 (+1571.23%)
Mutual labels:  vue-component, vuejs2
Vue Touch Ripple
πŸ‘† Touch ripple component for @vuejs
Stars: ✭ 443 (+506.85%)
Mutual labels:  vue-component, vuejs2
Vue2 Notify
Simple Vue2 notification component
Stars: ✭ 36 (-50.68%)
Mutual labels:  vue-component, vuejs2
Vue Social Sharing
A renderless Vue.js component for sharing links to social networks, compatible with SSR
Stars: ✭ 1,071 (+1367.12%)
Mutual labels:  vue-component, vuejs2

vue-numeral-filter

npm version MadeWithVueJs.com shield tested with jest License: MIT

Vue.js filter for Numeral.js

Allows for Numeral.js to be used inline in the template section of a component. This can be a convenient way of rendering numerically formatted data in situations where you do not wish to create a computed property.

Demonstration

https://jsfiddle.net/lloydjatkinson/uaq69zjc/

Installation

NPM

This is the recommended approach.

npm install vue-numeral-filter
import vueNumeralFilterInstaller from 'vue-numeral-filter';

Vue.use(vueNumeralFilterInstaller, { locale: 'en-gb' });

CDN - Browser UMD Module

The UMD bundle will automatically install the filters.

<script src="https://cdn.jsdelivr.net/npm/vue-numeral-filter/dist/vue-numeral-filter.min.js"></script>

Usage

The numeral filter accepts any of the formats specified in the Numeral.js documentation. For example:

{{ 561739482 | numeral('0,0') }} // => 561,739,482

Predefined Filters

A number of commonly used predefined filters are also provided for ease-of-use and readability.

Type Numeral Alias Result
Bytes {{ 10485760 | numeral('0b') }} {{ 10485760 | bytes }} 10 MB
Percentage {{ 0.5567 | numeral('0.[00]%') }} {{ 0.5567 | percentage }} 55.67%
Thousands Separator {{ 561739482 | numeral('0,0') }} {{ 561739482 | separator }} 561,739,482
Ordinal {{ 20 | numeral('Oo') }} {{ 20 | ordinal }} 20th
Abbreviate {{ 1000000 | numeral('0.0a') }} {{ 1000000 | abbreviate }} 1.0m
Exponential {{ 123987.202 | numeral('0.[00]e+0') }} {{ 123987.202 | exponential }} 1.24e+5
Currency {{ 200.42 | numeral('$0,0.00') }} {{ 200.42 | currency }} Β£200.42

Locales

See the list of locales here: https://github.com/adamwdraper/Numeral-js/tree/master/src/locales

Find this library useful?

ko-fi

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].