Skip to content

cupertino-files / encodeDecimal128

Function: encodeDecimal128()

encodeDecimal128(value): Uint8Array

Defined in: src/tst/cellrecord.ts:250

Encode a JS number as IEEE 754-2008 decimal128 (binary significand).

The significand is derived from the shortest decimal string that round-trips the double, so 0.1 stores as 1×10⁻¹ rather than the binary approximation — which is the whole reason Numbers uses decimal128, and what stops a written 0.1 from displaying as 0.1000000000000000055511151.

Parameters

value

number

Returns

Uint8Array

MIT licensed. Independently made — not by Apple in California. Not affiliated with or endorsed by Apple Inc.