const m=new WeakMap;function u(c=!1,o=2,f){const e={};let t=m.get(e);t||(t=new Intl.NumberFormat(f,{notation:"compact",maximumFractionDigits:o}),m.set(e,t));function s(a){let r=a;if(c){const n=Math.pow(10,o);r=Math.floor(a*n)/n}return t.format(r)}return s}export{u};