Function
createAmountFromBalance
createAmountFromBalance(num: bigint, decimals?: number): AmountReturns a new asset amount.
Parameters
- num: bigint
The desired value for the amount, specified as smallest divisor.
Optionaldecimals: numberThe desired number of decimal digits.
Returns Amount
An asset amount with the specified value, and a decimal point added to it if needed. In this function, 1 is always the smallest non-zero amount that can be represented. If you want to convert user input to amounts, you'll probably want to use createAmount instead.
Example
TypeScriptcreateAmountFromBalance(1, 2) // returns 0.01 createAmountFromBalance(100, 2) // returns 1.00- num: bigint