vue-round-filter

1.1.2 • Public • Published

vue-round-filter

round number with whichever decimal accuracy

installation

let round = require('vue-round-filter');
// or es6
import round from 'vue-round-filter';
new Vue({
  filters: {
    round,
  },
});

usage

let pi = 3.14159265359;
<span> {{ pi | round }} </span>
<span> 3 </span>
 
<span> {{ pi | round 2 }} </span>
<span> 3.14 </span>

If you're need to keep decimal accuracy, pass true as second argument

let int = 3;
<span> {{ int | round 3 }} </span>
<span> 3 </span>
 
<span> {{ int | round 3 true }} </span>
<span> 3.000 </span>

Package Sidebar

Install

npm i vue-round-filter

Weekly Downloads

242

Version

1.1.2

License

ISC

Last publish

Collaborators

  • rascada