Appearance
@swapped/connect-sdk / format / convertAmountToBigIntString
Function: convertAmountToBigIntString()
convertAmountToBigIntString(
amount,decimals):string
Defined in: src/format/convertAmountToBigIntString.ts:12
Converts a human-readable token amount into a smallest-unit integer string (e.g. "1.5" ETH with 18 decimals → "1500000000000000000"). Truncates excess fractional digits before parsing; does not round up.
Parameters
amount
string | number
Human amount as string or number
decimals
number
Token decimal places for the conversion
Returns
string
Smallest-unit amount as a decimal integer string