10 lines
198 B
JavaScript
10 lines
198 B
JavaScript
|
function amountToInteger(n) {
|
||
|
return Math.round(n * 100) | 0;
|
||
|
}
|
||
|
|
||
|
function integerToAmount(n) {
|
||
|
return parseFloat((n / 100).toFixed(2));
|
||
|
}
|
||
|
|
||
|
module.exports = { amountToInteger, integerToAmount };
|