import formatDecimal from"./format-decimal";var prefixExponent;var formatPrefixAuto=function formatPrefixAuto(x,p){var d=formatDecimal(x,p);var coefficient,exponent,i,n;if(!d)return x+"";coefficient=d[0];exponent=d[1];i=exponent-(prefixExponent=Math.max(-8,Math.min(8,Math.floor(exponent/3)))*3)+1;n=coefficient.length;if(i===n){return coefficient}else if(i>n){return coefficient+new Array(i-n+1).join("0")}else if(i>0){return coefficient.slice(0,i)+"."+coefficient.slice(i)}return"0."+new Array(1-i).join("0")+formatDecimal(x,Math.max(0,p+i-1))[0]};export{prefixExponent};export default formatPrefixAuto;