Skip to content

@token.decimals

Return the number of decimals of a token.

Returns: number

@token.decimals(tokenSymbol)
NameTypeDescription
tokenSymboltoken-symbolToken symbol (e.g. DAI) or address
# Read the decimals of a token
set $decimals @token.decimals(DAI)
# Scale an amount manually
set $base @num(25 * 10 ^ @token.decimals(DAI))