const e=require("./supportUtil.js");function t(e){let t=e.trim(),n=t.startsWith(`-`);n&&(t=t.slice(1)),t=t.replace(/(\.\d*[^0])0*$/,`$1`).replace(/\.0*$/,``).replace(/^0+/,``),t.startsWith(`.`)&&(t=`0${t}`);let r=t||`0`,i=r.split(`.`),a=i[0]||`0`,o=i[1]||`0`;a===`0`&&o===`0`&&(n=!1);let s=n?`-`:``;return{negative:n,negativeStr:s,trimStr:r,integerStr:a,decimalStr:o,fullStr:`${s}${r}`}}function n(e){let t=String(e);return!Number.isNaN(Number(t))&&t.includes(`e`)}function r(e){let t=String(e);if(n(e)){let e=Number(t.slice(t.indexOf(`e-`)+2)),n=t.match(/\.(\d+)/);return n?.[1]&&(e+=n[1].length),e}return t.includes(`.`)&&a(t)?t.length-t.indexOf(`.`)-1:0}function i(i){let a=String(i);if(n(i)){if(i>2**53-1)return String(e.supportBigInt()?BigInt(i).toString():2**53-1);if(i<-(2**53-1))return String(e.supportBigInt()?BigInt(i).toString():-(2**53-1));a=i.toFixed(r(a))}return t(a).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=r,exports.isE=n,exports.num2str=i,exports.trimNumber=t,exports.validateNumber=a;