Home Manual Reference Source Repository

src/plugins/easycurrency/formatters/Formatter.js

/**
 * Formats currencies.
 * This is an abstract class which formatters should extend from.
 * @public
 */
export default class Formatter {

    /**
     * Format a currency.
     * @param {type}	amount - Amount in cents.
     * @param {type}	currency - Currency code to convert to.
     * @return {String}
     */
    format(amount, currency) {
        throw Error('Formatter should implement format');
    }
}