Function: toDisplayAmount()
function toDisplayAmount(nativeAmount, asset): string;
Defined in: packages/overcast-core/src/assets/index.ts:190
Convert a native integer amount to a whole-token (display) decimal string,
exactly — e.g. 1_500_000_000n SOL (9 decimals) → "1.5".
Parameters
| Parameter | Type | Description |
|---|---|---|
nativeAmount | bigint | - |
asset | { address: string; cashLike?: boolean; chain?: string; coinGeckoId?: string; decimals?: number; lastKnownPriceUsd?: number; logoUrl?: string; name?: string; rwa?: boolean; symbol?: string; volatility?: number; } | - |
asset.address | string | The on-chain address (mint) that uniquely identifies the asset. |
asset.cashLike? | boolean | Whether or not the asset can be treated similar to cash |
asset.chain? | string | The chain the asset lives on. |
asset.coinGeckoId? | string | CoinGecko id for price lookups, e.g. usd-coin. |
asset.decimals? | number | Number of decimal places in the asset's native units. |
asset.lastKnownPriceUsd? | number | Last known USD price, sourced best-effort from an external feed (CoinGecko). Untrusted — do not use for settlement, signing, valuation, or any value transfer. It is informational only (e.g. showing an approximate notional in a picker), may be stale, missing, or wrong, and is never part of the canonical, content-addressed asset identity. Present only once a price has actually been fetched for the asset. |
asset.logoUrl? | string | Logo of the coin |
asset.name? | string | Human name of the asset. |
asset.rwa? | boolean | Whether the asset is a real-world asset (RWA) — e.g. tokenized private equity — rather than a native crypto asset. |
asset.symbol? | string | Human ticker, e.g. USDC. |
asset.volatility? | number | Volatility of the asset |
Returns
string