feat(medusa): PriceList import strategy (#2210)

This commit is contained in:
Sebastian Rindom
2022-09-28 15:30:15 +02:00
committed by GitHub
parent 884f36e8a8
commit 7dc8d3a0c9
17 changed files with 1129 additions and 21 deletions
@@ -0,0 +1,13 @@
import zeroDecimalCurrencies from "./zero-decimal-currencies"
const computerizeAmount = (amount, currency) => {
let divisor = 100
if (zeroDecimalCurrencies.includes(currency.toLowerCase())) {
divisor = 1
}
return Math.round(amount * divisor)
}
export default computerizeAmount
+1 -1
View File
@@ -4,8 +4,8 @@ export { default as createRequireFromPath } from "./create-require-from-path"
export { default as MedusaError } from "./errors"
export { default as getConfigFile } from "./get-config-file"
export { default as humanizeAmount } from "./humanize-amount"
export { default as computerizeAmount } from "./computerize-amount"
export { indexTypes } from "./index-types"
export { transformIdableFields } from "./transform-idable-fields"
export { default as Validator } from "./validator"
export { default as zeroDecimalCurrencies } from "./zero-decimal-currencies"