actual/packages/api/utils.js

10 lines
194 B
JavaScript
Raw Normal View History

2022-04-29 02:44:38 +00:00
function amountToInteger(n) {
return Math.round(n * 100);
2022-04-29 02:44:38 +00:00
}
function integerToAmount(n) {
return parseFloat((n / 100).toFixed(2));
}
module.exports = { amountToInteger, integerToAmount };