Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/hex/src/lib/stdx/fmt.ts>bytes.format

An ecosystem delivering practices, philosophy and portability. Powered By Deno and JavaScript.
Latest
function bytes.format
import { bytes } from "https://deno.land/x/hex@0.6.5/src/lib/stdx/fmt.ts";
const { format } = bytes;

Convert bytes to a human-readable string: 1337 → 1.34 kB

Parameters

num: number

The number to format

optional
options: FormatOptions = [UNSUPPORTED]

The options

Returns

string