/** * Check and normalise the value of precision (must be positive integer) */ export declare function checkPrecision(val: any, base?: number): any; /** * Parses a format string or object and returns format obj for use in rendering * * `format` is either a string with the default (positive) format, or object * containing `pos` (required), `neg` and `zero` values (or a function returning * either a string or object) * * Either string or format.pos must contain "%v" (value) to be valid */ export declare function checkCurrencyFormat(format: any): any; export declare const unformat: (value: any, decimal?: any) => any; /** * Implementation of toFixed() that treats floats more like decimals * * Fixes binary rounding issues (eg. (0.615).toFixed(2) === "0.61") that present * problems for accounting- and finance-related software. */ export declare const toFixed: (value: any, precision: any) => string; /** * Format a number, with comma-separated thousands and custom precision/decimal places * Alias: `accounting.format()` * * Localise by overriding the precision and thousand / decimal separators * 2nd parameter `precision` can be an object matching `settings.number` */ export declare const formatNumber: (number: any, precision: any, thousand: any, decimal: any, avoidEmptyDecimals: any) => any; /** * Format a number into currency * * Usage: accounting.formatMoney(number, symbol, precision, thousandsSep, decimalSep, format) * defaults: (0, "$", 2, ",", ".", "%s%v") * * Localise by overriding the symbol, precision, thousand / decimal separators and format * Second param can be an object matching `settings.currency` which is the easiest way. * * To do: tidy up the parameters */ export declare const formatMoney: (number: any, symbol: any, precision: any, thousand: any, decimal: any, format: any, avoidEmptyDecimals: any) => any;