//#region src/convert-currency-to-words/convert-currency-to-words.d.ts /** * Formats a monetary amount in Brazilian Reais as its "por extenso" textual representation, * the style used to write out the amount by hand on cheques and contracts, e.g. `1523.45` * becomes `"mil quinhentos e vinte e três reais e quarenta e cinco centavos"`. * * `value` is truncated (not rounded) to 2 decimal places before conversion, matching * `brutils`' `convert_real_to_text`. The singular noun is used for exactly 1 ("um real", * "um centavo") and "de" is inserted before "reais" when the amount is a round million, * billion or trillion of reais ("um milhão de reais", "dois milhões de reais"). An amount that * truncates to nothing becomes `"zero reais"`, with no "menos" prefix even when `value` is * negative (`-0.001` is not a debt of anything); any other negative amount is prefixed with * "menos". `NaN`/non-finite values and amounts whose reais exceed `NUMBER_TO_WORDS_MAX_VALUE` * (999 trillion) return `""`. Above `Number.MAX_SAFE_INTEGER / 100` reais (about 90 trillion) a * double cannot carry cents at all, so the amount is read as a whole number of reais instead of * reporting cents that the input never held. * * The result is always lowercase; apply any other casing to it yourself. * * @param {number} value - The monetary amount to convert, in reais (e.g. `1523.45` for R$ 1.523,45). * @returns {string} The amount written out in Portuguese, or `""` for invalid input. * * @example * ```typescript * convertCurrencyToWords(1523.45); // "mil quinhentos e vinte e três reais e quarenta e cinco centavos" * convertCurrencyToWords(1); // "um real" * convertCurrencyToWords(0.01); // "um centavo" * convertCurrencyToWords(1000000); // "um milhão de reais" * convertCurrencyToWords(0); // "zero reais" * convertCurrencyToWords(-5.5); // "menos cinco reais e cinquenta centavos" * convertCurrencyToWords(-0.001); // "zero reais" * ``` * * @see Based on: https://github.com/brazilian-utils/python/blob/main/brutils/currency.py */ export declare const convertCurrencyToWords: (value: number) => string; //#endregion