@fleetbase/ember-ui
Version:
Fleetbase UI provides all the interface components, helpers, services and utilities for building a Fleetbase extension into the Console.
9 lines (6 loc) • 409 B
JavaScript
import getCurrency from './get-currency';
import formatMoney from '@fleetbase/ember-accounting/utils/format-money';
export default function formatCurrency(amount = 0, currencyCode = 'USD') {
let currency = getCurrency(currencyCode);
return formatMoney(!currency.decimalSeparator ? amount : amount / 100, currency.symbol, currency.precision, currency.thousandSeparator, currency.decimalSeparator);
}