mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-11 20:44:32 -05:00
This PR converts everything (aside from electron) from CommonJS to ESM. It is needed to reduce the changes that will happen during the migration to Typescript (as TS does not play nice with CJS). Basically: - rewrite `require()` to `import` - rewrite `module.exports` to `exports` - introduce `ts-node` to run importers so we can convert them to TS too Lastly, sorry for this larg-ish PR, not my preference but when I tried to reduce its scope, I would end up with mixed commons/esm that was even more tricky to handle.
8 lines
152 B
JavaScript
8 lines
152 B
JavaScript
export function amountToInteger(n) {
|
|
return Math.round(n * 100);
|
|
}
|
|
|
|
export function integerToAmount(n) {
|
|
return parseFloat((n / 100).toFixed(2));
|
|
}
|