A minimal, dependency-free arbitrary-precision decimal for ClojureScript,
mirroring java.math.BigDecimal: an unscaled js/BigInt value and an integer
scale, where the numeric value = unscaled x 10^(-scale).
This is the canonical value produced by the Fressian BIGDEC (0xC7) reader and
consumed by the BIGDEC writer — the exact counterpart of JVM Fressian's
default BigDecimal support (and the sibling of fress's own bigint handling).
Downstream consumers that need decimal arithmetic (e.g. a bignumber.js-backed
money type) convert to/from Bigdec via ->unscaled / ->scale / bigdec.
A minimal, dependency-free arbitrary-precision decimal for ClojureScript, mirroring java.math.BigDecimal: an unscaled `js/BigInt` value and an integer `scale`, where the numeric value = unscaled x 10^(-scale). This is the canonical value produced by the Fressian BIGDEC (0xC7) reader and consumed by the BIGDEC writer — the exact counterpart of JVM Fressian's default BigDecimal support (and the sibling of fress's own bigint handling). Downstream consumers that need decimal arithmetic (e.g. a bignumber.js-backed money type) convert to/from `Bigdec` via `->unscaled` / `->scale` / `bigdec`.
(->scale bd)(->str bd)(->unscaled bd)(bigdec unscaled scale)Construct a Bigdec from an unscaled js/BigInt and an integer scale.
Construct a Bigdec from an unscaled `js/BigInt` and an integer scale.
(bigdec? x)cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |