UNPKG

@accounter/server

Version:
10 lines (9 loc) 930 B
import type { FinancialAmount, FinancialIntAmount } from '../../__generated__/types.js'; import { Currency } from '../enums.js'; export declare const addCommasToStringifiedInt: (rawAmount: string | number) => string; export declare const formatStringifyAmount: (rawAmount: number) => string; export declare const formatFinancialAmount: (rawAmount?: number | string | null, rawCurrency?: string | null) => FinancialAmount; export declare function formatCurrency<T extends boolean = false>(raw?: string | null, nullable?: T): Currency | (T extends true ? null : never); export declare function getCurrencySymbol(currency: Currency): "GRT" | "USDC" | "$" | "£" | "€" | "C$" | "¥" | "A$" | "kr" | "₪" | "Ξ"; export declare const formatFinancialIntAmount: (rawAmount?: number | string | null, rawCurrency?: string | null) => FinancialIntAmount; export declare const formatAmount: (rawAmount?: number | string | null) => number;