Skip to main content

@std/fmt@0.215.0

latest
Works with
It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun
It is unknown whether this package works with Browsers
It is unknown whether this package works with Deno
It is unknown whether this package works with Node.js
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Bun
JSR Score58%
Published2 years ago (0.215.0)

Functions

f
format(
num: number,
options?: FormatOptions
): string

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

Interfaces

I

Options for format.

  • binary: boolean

    Uses binary bytes (e.g. kibibyte).

  • bits: boolean

    Uses bits representation.

  • locale: boolean | string | string[]

    Uses localized number formatting. If it is set to true, uses default locale on the system. If it's set to string, uses that locale. The given string should be a BCP 47 language tag. You can also give the list of language tags.

  • The maximum number of fraction digits to display. If neither minimumFractionDigits or maximumFractionDigits are set, the default behavior is to round to 3 significant digits.

  • The minimum number of fraction digits to display. If neither minimumFractionDigits or maximumFractionDigits are set, the default behavior is to round to 3 significant digits.

  • signed: boolean

    Include plus sign for positive numbers.

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/fmt

Import symbol

import * as mod from "@std/fmt/bytes";
or

Import directly with a jsr specifier

import * as mod from "jsr:@std/fmt/bytes";