vue-filter-pretty-bytes

Vue 2 Filter to prettify bytes
25,953 3
Install
npm install vue-filter-pretty-bytes
Latest Version:0.1.6
License:MIT
Last Updated:Mar 29, 2022
Links: GitHub  ·  npm
Maintainer: sainf

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

A timeago filter for Vue.

467,807 717
vue-truncate-filter

A filter for VueJs to truncate string

78,257 56
vue-filter

A collection of Vue.js filter.

35,738
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