Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rascada/vue-round-filter
as above
https://github.com/rascada/vue-round-filter
Last synced: 4 months ago
JSON representation
as above
- Host: GitHub
- URL: https://github.com/rascada/vue-round-filter
- Owner: rascada
- Created: 2016-01-17T18:43:31.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-03-22T00:10:57.000Z (almost 5 years ago)
- Last Synced: 2024-09-19T00:13:50.177Z (5 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-vue-cn - vue-round-filter ★0
README
# vue-round-filter
#### round number with whichever decimal accuracy## installation
```javascript
const round = require('vue-round-filter');
```
```javascript
new Vue({
filters: {
round,
},
});
```
## usage
```javascript
let pi = 3.14159265359;
```
```html
{{ pi | round }}
3{{ pi | round(2) }}
3.14
```
If you're need to keep decimal accuracy, pass `true` as second argument```javascript
let int = 3;
```
```html
{{ int | round(3) }}
3{{ int | round(3, true) }}
3.000
```