Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
vue-number-format
Advanced tools
A lightweight flexible Vue.js 2 and 3 component to display and input formatted numbers and currencies
Readme
A lightweight flexible Vue.js 2 and 3 component to display and input formatted numbers and currencies
Install npm module:
yarn add vue-number-format
or
npm i -S vue-number-format
import { createApp } from 'vue'
import App from './App.vue'
import VueNumberFormat from 'vue-number-format'
const app = createApp(App)
app.use(VueNumberFormat, {prefix: 'US$ ', decimal: ',', thousand: '.'})
app.mount('#app')
// plugins/index.ts
import VueNumberFormat from '@igortrindade/vue-number-format'
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(VueNumberFormat, { prefix: 'R$ ', decimal: '.', thounsand: ',' })
})
import Vue from 'vue'
import App from './App.vue'
import VueNumberFormat from 'vue-number-format'
Vue.use(VueNumberFormat, {prefix: 'R$ ', decimal: ',', thousand: '.'})
new Vue({
render: h => h(App),
}).$mount('#app')
<!-- VUE 3 -->
<VueNumberFormat
v-model:value="value"
:options="{ precision: 3, prefix: '', suffix: ' kg', decimal: '', thousand: '', acceptNegative: false, isInteger: false }"
></VueNumberFormat>
<!-- https://v3.vuejs.org/guide/component-custom-events.html#v-model-arguments -->
<!-- VUE 2 -->
<VueNumberFormat
v-model="value"
:options="{ precision: 3, prefix: '', suffix: ' kg', decimal: '', thousand: '', acceptNegative: false, isInteger: false }"
></VueNumberFormat>
{{vueNumberFormat(275, {})}}
<!-- display US$275.00 -->
<!-- Available only within global instalation -->
<!-- use like a component method -->
<!-- Filters are removed from Vue 3.0 and no longer supported: https://v3.vuejs.org/guide/migration/filters.html-->
This is the default package options, feel free to change for anything you need
{
prefix: 'US$ ',
suffix: '',
decimal: ',',
thousand: '.',
precision: 2,
acceptNegative: true,
isInteger: false
}
npm run test
This project is licensed under the MIT License - see the LICENSE file for details.
v1.1.0
v.1.3.0
Added support to Nuxt 3
FAQs
A lightweight flexible Vue.js 2 and 3 component to display and input formatted numbers and currencies
The npm package vue-number-format receives a total of 1,045 weekly downloads. As such, vue-number-format popularity was classified as popular.
We found that vue-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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.