actual/packages/api/utils.js
2022-11-10 12:33:19 -05:00

9 lines
194 B
JavaScript

function amountToInteger(n) {
return Math.round(n * 100);
}
function integerToAmount(n) {
return parseFloat((n / 100).toFixed(2));
}
module.exports = { amountToInteger, integerToAmount };