"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./supportUtil.js");function N(e){let t=e.trim(),r=t.startsWith("-");r&&(t=t.slice(1)),t=t.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),t.startsWith(".")&&(t=`0${t}`);const i=t||"0",s=i.split("."),u=s[0]||"0",c=s[1]||"0";u==="0"&&c==="0"&&(r=!1);const l=r?"-":"";return{negative:r,negativeStr:l,trimStr:i,integerStr:u,decimalStr:c,fullStr:`${l}${i}`}}function n(e){const t=String(e);return!Number.isNaN(Number(t))&&t.includes("e")}function f(e){const t=String(e);if(n(e)){let r=Number(t.slice(t.indexOf("e-")+2));const i=t.match(/\.(\d+)/);return i?.[1]&&(r+=i[1].length),r}return t.includes(".")&&a(t)?t.length-t.indexOf(".")-1:0}function S(e){let t=String(e);if(n(e)){if(e>Number.MAX_SAFE_INTEGER)return String(o.supportBigInt()?BigInt(e).toString():Number.MAX_SAFE_INTEGER);if(e<Number.MIN_SAFE_INTEGER)return String(o.supportBigInt()?BigInt(e).toString():Number.MIN_SAFE_INTEGER);t=e.toFixed(f(t))}return N(t).fullStr}function a(e){return typeof e=="number"?!Number.isNaN(e):e?/^\s*-?\d+(\.\d+)?\s*$/.test(e)||/^\s*-?\d+\.\s*$/.test(e)||/^\s*-?\.\d+\s*$/.test(e):!1}exports.getNumberPrecision=f;exports.isE=n;exports.num2str=S;exports.trimNumber=N;exports.validateNumber=a;
