import{g as f}from"./useEventListener-C0195JsF.js";import{t as c}from"./once-CGKw_kwj.js";const a=c(t=>{for(let i of[100,20,2,0])try{return new Intl.NumberFormat(t,{minimumFractionDigits:0,maximumFractionDigits:i}).format(1),i}catch(n){f.error(n)}return 0});function u(t){if(!Number.isFinite(t)||t===0)return 0;let i=t.toFixed(12).replace(/\.?0+$/,""),n=i.indexOf(".");return n===-1?0:i.length-n-1}function s(t,i){let n=u(i);for(let r of t)n=Math.max(n,u(r));return n}function g(t,i){return Number(t.toFixed(i))}function F(t,i){return t==null?"":Array.isArray(t)?String(t):typeof t=="string"?t:typeof t=="boolean"?String(t):typeof t=="number"||typeof t=="bigint"?t.toLocaleString(i,{minimumFractionDigits:0,maximumFractionDigits:2}):String(t)}function e(t){return t===0?"0":Number.isNaN(t)?"NaN":Number.isFinite(t)?null:t>0?"Infinity":"-Infinity"}function b(t,i){let n=e(t);if(n!==null)return n;let r=Math.abs(t);if(r<.01||r>=1e6)return new Intl.NumberFormat(i.locale,{minimumFractionDigits:1,maximumFractionDigits:1,notation:"scientific"}).format(t).toLowerCase();let{shouldRound:o,locale:m}=i;return o?new Intl.NumberFormat(m,{minimumFractionDigits:0,maximumFractionDigits:2}).format(t):t.toLocaleString(m,{minimumFractionDigits:0,maximumFractionDigits:a(m)})}var l={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 N(t,i){let n=e(t);if(n!==null)return n;let[r,o]=new Intl.NumberFormat(i,{notation:"engineering",maximumSignificantDigits:3}).format(t).split("E");return o in l?r+l[o]:`${r}E${o}`}export{b as a,F as i,a as n,g as o,N as r,s as t};
