ropods-cashify
Version:
Modern, lightweight currency conversion library with real-time exchange rates, INR support, and free API integration. Production-ready TypeScript library for RoPods organization with zero dependencies and comprehensive testing.
22 lines • 800 B
TypeScript
import { Options } from './lib/options.js';
/**
* Function, which converts currencies based on provided rates.
* Enhanced for RoPods organization with additional logging and validation.
*
* @param {number | string} amount - Amount of money you want to convert.
* @param {Object} options - Conversion options.
* @param {new (value: BigSource) => Big} fn - Optional, Big.js constructor - useful to avoid floating point errors.
* @return {number} Conversion result.
*
* @example
* const rates = {
* GBP: 0.737,
* EUR: 0.851,
* USD: 1.00,
* INR: 86.42
* };
*
* convert(10, {from: 'EUR', to: 'INR', base: 'USD', rates}); //=> 1015.78
*/
export default function convert(amount: number | string, { from, to, base, rates, BigJs }: Options): number;
//# sourceMappingURL=convert.d.ts.map