Web Component: Tangular-FileSize


  • Info
  • HTML
  • JS
  • CSS
  • Meta

Tangular-FileSize

A simple Tangular template engine helper for rendering humanable size of file or directory. Number contains prototype Number.filesize().

  • jComponent v19|v20
(100).filesize([type])
// type {String} optional, can contain bytes, KB, MB, GB or TB (default: __empty__)

Outputs:

  • 1 kB
  • 5 bytes
  • 10 MB
  • 1.5 GB

Usage:

<h1>{{ name }}</h1>
<div>{{ size | filesize }}</div>

or

console.log(Thelpers.filesize(1000));