import { SymbolFactor } from "../../../types/src"; /** * Formats the integer amount which represents the multiple * of the smallest unit of account defined by symbol factor. * Output is the nominal amount formatted as currency with * fixed number of decimal places defined by factor. * @example * formatLedgerAmount(1234500, 1) * // returns a string value $1,234,500 * formatLedgerAmount(12345, 1) * // returns a string value $12,345 * formatLedgerAmount(1234500, 100) * // returns a string value $12,345.00 * formatLedgerAmount(12345, 100) * // returns a string value $123.45 * * @param ledgerAmount integer input amount * @param factor symbol factor * @returns formatted amount */ export declare function formatLedgerAmount(ledgerAmount: number, factor: SymbolFactor): string; /** * Converts ledger integer amount into nominal amount depending * on the symbol factor. * * @param ledgerAmount integer ledger amount * @param factor symbol factor * @returns nominal amount * @throws if input ledger amount is not an integer */ export declare function fromLedgerAmount(ledgerAmount: number, factor: SymbolFactor): number; /** * Converts nominal amount into ledger integer amount depending * on the symbol factor. * * @param nominalAmount nominal amount * @param factor symbol factor * @returns integer ledger amount * @throws if input nominal amount doesn't produce an integer amount * with given factor */ export declare function toLedgerAmount(nominalAmount: number, factor: SymbolFactor): number; /** * Formats a list of items so that they can be included * in a sentence. * * For example: * ``` * ['a', 'b', 'c'] -> a, b, and c * ['a', 'b'] -> a and b * ['a'] -> a * ``` * * @param items items list to format * @returns items list in a sentence form */ export declare function formatList(items: string[]): string; /** * Performs basic word pluralization by adding a provided * suffix to the word in case a plural form needs to be used. * This function is useful if you need to display a word after * a count or a list of items in a sentence. * * For example, if the provide noun is coin: * ``` * count: 0 -> coins * count: 1 -> coin * count: 24 -> coins * ``` * * @param count count to use for pluralization * @param noun noun to pluralize * @param suffix suffix to use for the plural form * @returns returns a pluralized word */ export declare function pluralize(count: number, noun: string, suffix?: string): string; /** * Formats a date into proper iso string format. * * @param date date to format * @returns date in iso string format */ export declare function formatDate(date?: Date): string;