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

std/fmt/bytes.ts>format

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function format
import { format } from "https://deno.land/std@0.199.0/fmt/bytes.ts";

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