@adyen/adyen-web
Version:
[](https://www.npmjs.com/package/@adyen/adyen-web)
3 lines (2 loc) • 968 B
JavaScript
import r from"./constants/currency-decimals.js";import{currencyMinorUnitsConfig as t}from"./constants/currency-minor-units.js";function e(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function n(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},c=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(c=c.concat(Object.getOwnPropertySymbols(n).filter((function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})))),c.forEach((function(t){e(r,t,n[t])}))}return r}const c=t=>r[t]||100,o=(r,t)=>{const e=c(t);return parseInt(String(r),10)/e},u=(r,e,c,u={})=>{const i=r.toString(),s=o(i,c),a=e.replace("_","-"),l=t[c]?n({},u,t[c]):u,y=n({style:"currency",currency:c,currencyDisplay:"symbol"},l);try{return s.toLocaleString(a,y)}catch(r){return i}};export{o as getDecimalAmount,c as getDivider,u as getLocalisedAmount};
//# sourceMappingURL=amount-util.js.map