decUnits
decUnits(
value):bigint
Defined in: src/attr/values.ts:255
The exact scaled integer behind a dec — the value multiplied by 10 ** 18, which is what the
protocol stores and compares. Use it when you need exact arithmetic; JavaScript has no native
decimal type, so the SDK carries the canonical string and leaves the maths to you.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”bigint
Example
Section titled “Example”decUnits(dec("3.5")) // 3500000000000000000n