vue-filter-pretty-bytes
vue-filter-pretty-bytes
Vue 2 Filter to prettify bytes
Install
Available through npm as vue-filter-pretty-bytes, or include as an inline script.
import Vue from 'vue'
import vueFilterPrettyBytes from 'vue-filter-pretty-bytes'
Vue.use(vueFilterPrettyBytes)
or
Vue.use(require('vue-filter-pretty-bytes'))
Usage
{{ 15364878 | prettyBytes }}
Return: 15.36 MB
everywhere like methods, etc...
this.$options.filters.prettyBytes(15364878)
Options
Decimals and KiB
Decimals - Integer
{{ 15364878 | prettyBytes(1) }}
Return: 15.4 MB
KiB - Boolean
{{ 15364878 | prettyBytes(1, true) }}
Return: 14.7 MiB
Max Unit
Normal
{{ 15364878 | prettyBytes(1, false, 'KB') }}
Options: 'Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB', 'BB'
Return: 15364.9 KB
KiB
{{ 15364878 | prettyBytes(1, true, 'KiB') }}
Options: 'Bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB', 'BiB'
Return: 15004.8 KiB
Related Packages
@opengis/filter
A flexible and extensible filter component system for Vue 3. Ideal for building...
10,212
0
vue-json-pretty
A JSON tree view component that is easy to use and also supports data selection.
10,656,769
1,471
Version History
| Version | Released | License |
|---|---|---|
| 0.1.6 | MIT | |
| 0.1.5 | MIT | |
| 0.1.4 | MIT | |
| 0.1.3 | MIT | |
| 0.1.2 | MIT | |
| 0.1.1 | MIT | |
| 0.1.0 | MIT | |
| 0.0.1 | MIT |