Back to Explore

d3/d3-format

GitHub
1 updates · last 90 daysOpen source

Last release:

d3-format is a JavaScript module for formatting numbers for human consumption. It produces consistent, comparable output and supports features like grouped digits, currencies, and scientific notation.

Project status

  • The source is actively maintained, with an upstream push and update on 2026-11-03.
  • The update history is uneven: after a long gap following 2021, there were several updates in January 2026 and another in November 2026.

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v3.1.3

    v3.1.3 updates the development toolchain, switches CI and tests to pnpm and Vitest, and publishes a bundled ES module alongside the existing UMD bundles. The package entry points now target the generated bundle rather than the source tree, which may affect consumers relying on source-file paths.

    BreakingFeatures
  • v3.1.2

    v3.1.2 focuses on ES2019 compatibility by removing optional chaining usage. The only runtime code change is in src/locale.js, where option property access was rewritten to avoid optional chaining syntax.

  • v3.1.1

    v3.1.1 contains targeted bug fixes for d3-format rounding and SI-prefix formatting edge cases, including NaN and Infinity handling. It also includes tooling upgrades (ESLint, Vitest, related build tooling) and corresponding test refactors.

    Breaking
  • v3.1.0

    d3-format v3.1.0 updates how the package exports locale JSON files, and refreshes local definitions. It also updates the README documentation around formatting precision and the meaning of the `c` type, and upgrades development dependencies (as reflected in the lockfile).

    Features
  • v3.0.1

    v3.0.1 is a maintenance release with dependency updates and changes aimed at making the build output reproducible. The diff shows changes limited to packaging metadata and build tooling (Rollup config and the lockfile), not the library’s runtime source code.

  • v3.0.0

    v3.0.0 switches the package to an ES module build style and updates project configuration for modern tooling. The release notes only mention the module type change and Node.js 12+ requirement, but the diff shows additional package entrypoint, build, and test pipeline changes.

    Breaking
  • v2.0.0

    v2.0.0 changes the default locale formatting behavior so the minus sign character is now the Unicode minus (−) instead of hyphen-minus (-). It also aligns the implementation with ES2015-era JavaScript (for example, arrow functions), dropping support for older browsers like IE.

    Breaking
  • v1.4.5

    v1.4.5 changes the behavior of the `d` number format to avoid scientific notation for very large values (>= 1e21), switching to full digit output. It also updates build and dev dependencies (with a corresponding yarn.lock refresh).

    Breaking
  • v1.4.4

    v1.4.4 is a small bug fix release for d3-format number formatting edge cases involving sign handling. The documented change targets sign behavior for near-zero negative values when the `+` directive is used, and the code also adds/adjusts logic to correctly detect and preserve negative zero (-0).

  • v1.4.3

    v1.4.3 includes a fix to trimming insignificant trailing zeros in formatted exponent notation, plus an adjustment to package metadata so bundlers do not tree-shake the default locale side effects. The release notes describe both changes, and the diff shows corresponding updates in the formatter and package.json.

  • v1.4.2

    Release v1.4.2 primarily updates package metadata by adding the sideEffects flag to package.json. The accompanying diff also updates README documentation links and bumps a couple of development dependencies in the yarn.lock.