@lelantos-org/sdk / index / parseUnits
Function: parseUnits() โ
ts
function parseUnits(value, decimals): bigint;Defined in: @lelantos-org/sdk/dist/core/units.d.ts:12
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.