Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

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
```