@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
17 lines • 625 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.counterValueFormatter = void 0;
const counterValueFormatter = ({ currency, value, shorten, locale, }) => {
if (!value) {
return "-";
}
return new Intl.NumberFormat(locale, {
style: currency ? "currency" : "decimal",
currency,
notation: shorten ? "compact" : "standard",
maximumFractionDigits: shorten ? 3 : 8,
}).format(value);
};
exports.counterValueFormatter = counterValueFormatter;
exports.default = exports.counterValueFormatter;
//# sourceMappingURL=countervalueFormatter.js.map