@lelantos-org/sdk / protocol / parseUnits
Function: parseUnits()
ts
function parseUnits(value, decimals): bigint;Defined in: @lelantos-org/sdk/dist/protocol/units.d.ts:18
Decimal string → integer with decimals implied places.
ts
parseUnits("1.5", 18); // 1500000000000000000nParameters
| Parameter | Type |
|---|---|
value | string | number | bigint |
decimals | number |
Returns
bigint
Throws
on a malformed number, or more fraction digits than decimals can hold — the amount is never truncated silently.