UNPKG

@meijering/nestjs-molliepayment

Version:

NestJs Wrapper around Mollie Api

14 lines 595 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getOrderId = exports.convertCurrency = void 0; const convertCurrency = (amount = '') => { const iAmount = typeof amount === 'string' ? +amount.replace(',', '.') : amount; const amountToNumber = Math.round((Math.trunc(iAmount * 1000) / 1000 + Number.EPSILON) * 100) / 100; return amountToNumber.toFixed(2); }; exports.convertCurrency = convertCurrency; const getOrderId = (pref) => { return `${pref}-${new Date().getTime()}`; }; exports.getOrderId = getOrderId; //# sourceMappingURL=index.js.map