feat(medusa): PriceList import strategy (#2210)
This commit is contained in:
@@ -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
|
||||
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user