You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@formatjs/bigdecimal

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@formatjs/bigdecimal

BigInt-backed decimal arithmetic for ECMA-402 polyfills

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
3
Created
Source

@formatjs/bigdecimal

BigInt-backed decimal arithmetic library designed as a lightweight replacement for decimal.js in ECMA-402 polyfills.

Representation

Values are represented as mantissa × 10^exponent where:

  • mantissa is a bigint (signed, normalized — no trailing zeros)
  • exponent is a number (integer scaling factor)
  • Special flags handle NaN, ±Infinity, and -0

API

Implements the 27 methods used by @formatjs/ecma402-abstract:

  • Arithmetic: times, div, plus, minus, mod, abs, negated, pow, floor, ceil, log
  • Comparison: eq, lessThan, greaterThan, lessThanOrEqualTo, greaterThanOrEqualTo
  • Queries: isZero, isNaN, isFinite, isNegative, isPositive, isInteger
  • Conversion: toNumber, toString
  • Static: BigDecimal.pow, BigDecimal.set

Keywords

bigdecimal

FAQs

Package last updated on 19 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts