UNPKG

@multiversx/sdk-dapp-swap

Version:

A library to hold the main logic for swapping between tokens on the MultiversX blockchain

3 lines (2 loc) 484 B
import{d as o}from"./chunk-2SSURZ7Z.js";import{b as a,e as m}from"./chunk-QXTSQDB3.js";import{f as n}from"./chunk-5W737WN4.js";n();var c=({amount:e="0",decimals:s=0,digits:l=4,addCommas:i=!1,showLastNonZeroDecimal:u=!1})=>{if(e==null||!m(e))return"0";let r=f=>a({decimals:s,addCommas:i,input:e,digits:f,showLastNonZeroDecimal:u}),t=r(l);return t=parseFloat(t)>0?t:r(4+4),t=parseFloat(t)>0?t:r(4+9),parseFloat(t)>0?t:r(4+14)};export{c as a}; //# sourceMappingURL=chunk-P5DITO6J.js.map