Fork of james2doyle/vue-pretty-print-bytes-filter
Add precision options to the filter
A filter for Vue.js to format bytes into a nice human-readable format. I pretty (no pun intended) much just stole this from sindresorhus/pretty-bytes.
Available through npm as vue-pretty-bytes-filter
, or include as an inline script.
Add this line to your app.js after Vue loading
Vue.use(require('vue-pretty-bytes-filter'))
Template:
<em>{{ 1337 | prettyBytes(3) }}</em>
Render:
<em>1.34 kB</em>