/** * User-facing number formatting for DSL notifications (smart decimals, signs). */ /** * Display ticker for a Hyperliquid asset: always `$`-prefixed, with any `xyz:` dex * prefix stripped (`ETH` → `$ETH`, `xyz:MU` → `$MU`). Blank input yields an empty * string so callers never render a bare `$`. */ export declare function fmtAsset(asset: string): string; /** * Leverage suffix (`5×`, `2.5×`). Returns an empty string when leverage is unknown * or non-positive so the copy omits it entirely rather than ever printing a * meaningless `0×`. Callers join with a leading space only when this is non-empty. */ export declare function fmtLeverage(leverage: number | undefined): string; /** * Title-case trade direction for display (`LONG` → `Long`, `SHORT` → `Short`); * the spec examples never render the raw uppercase event value. Blank stays blank * so callers can omit an unknown direction entirely. */ export declare function fmtDirection(direction: string): string; /** * Build the `$ASSET Direction Nx` position label, title-casing the direction and * omitting the leverage when it is unknown/non-positive (never `0×`). E.g. * `$ETH Long 5×`, or `$ETH Long` when the leverage is missing. */ export declare function fmtPosition(asset: string, direction: string, leverage?: number): string; /** * Unsigned percentage magnitude with one decimal, for a distance/gap that is not a * signed P&L (e.g. "3.0% away"). Guards a value that would round to `0.0%` (never * `±0%` per the copy rules) by rendering `<0.1%` instead. */ export declare function fmtDistancePct(pct: number): string; /** * Smart USD price: BTC/ETH — whole dollars + grouping; everything else — two * significant fractional digits with subscript-compressed zeros. * * Let z = number of zeros between the decimal point and the first significant * fractional digit of abs(price). The value is rounded half-up to (z + 2) * fractional digits, z is recomputed on the rounded value (so a carry like * 0.0996 renders as $0.10), then: * - z == 0 → two decimals (0.45 → $0.45, 1555.23 → $1,555.23) * - z == 1 → three decimals (0.045 → $0.045, 1.045 → $1.045) * - z >= 2 → zeros compressed into a subscript count * (0.0045 → $0.0₂45, 0.0000045 → $0.0₅45) * Trailing significant zeros are kept (0.002 → $0.0₂20). Zero and non-finite * prices keep the legacy rendering ($0.00 / $0). */ export declare function fmtUsdPrice(price: number, asset?: string): string; /** * Signed P/L in USD with two decimals (+$80.27, -$48.15). */ export declare function fmtUsdPnl(amount: number): string; /** * ROE percent with one decimal and sign (+6.6%, -3.5%). Never renders `±0%` * (copy rules): a true zero is the unsigned `0.0%`, and a sub-0.1% magnitude * uses the same `<0.1%` guard as {@link fmtDistancePct}, keeping the sign of * the underlying value (`+<0.1%` / `-<0.1%`). */ export declare function fmtRoe(pct: number): string; //# sourceMappingURL=format-utils.d.ts.map