import{m as l}from"./useEventListener-CjXriKgk.js";import{t as s}from"./once-DRC4SgqY.js";const a=s(i=>{for(let t of[100,20,2,0])try{return new Intl.NumberFormat(i,{minimumFractionDigits:0,maximumFractionDigits:t}).format(1),t}catch(n){l.error(n)}return 0});function c(i,t){return i==null?"":Array.isArray(i)?String(i):typeof i=="string"?i:typeof i=="boolean"?String(i):typeof i=="number"||typeof i=="bigint"?i.toLocaleString(t,{minimumFractionDigits:0,maximumFractionDigits:2}):String(i)}function u(i){return i===0?"0":Number.isNaN(i)?"NaN":Number.isFinite(i)?null:i>0?"Infinity":"-Infinity"}function f(i,t){let n=u(i);if(n!==null)return n;let r=Math.abs(i);if(r<.01||r>=1e6)return new Intl.NumberFormat(t.locale,{minimumFractionDigits:1,maximumFractionDigits:1,notation:"scientific"}).format(i).toLowerCase();let{shouldRound:m,locale:o}=t;return m?new Intl.NumberFormat(o,{minimumFractionDigits:0,maximumFractionDigits:2}).format(i):i.toLocaleString(o,{minimumFractionDigits:0,maximumFractionDigits:a(o)})}var e={24:"Y",21:"Z",18:"E",15:"P",12:"T",9:"G",6:"M",3:"k",0:"","-3":"m","-6":"\xB5","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"};function g(i,t){let n=u(i);if(n!==null)return n;let[r,m]=new Intl.NumberFormat(t,{notation:"engineering",maximumSignificantDigits:3}).format(i).split("E");return m in e?r+e[m]:`${r}E${m}`}export{f as i,g as n,c as r,a as t};
