calc.0cdee66c.js 1.2 KB

1
  1. function u(t,i){let r,n,e;try{r=t.toString().split(".")[1].length}catch{r=0}try{n=i.toString().split(".")[1].length}catch{n=0}return e=Math.pow(10,Math.max(r,n)),(t*e+i*e)/e}function s(t,i){let r=0,n=0,e,o;try{r=t.toString().split(".")[1].length}catch{}try{n=i.toString().split(".")[1].length}catch{}return e=Number(t.toString().replace(".","")),o=Number(i.toString().replace(".","")),h(e/o,Math.pow(10,n-r))}function h(t,i){let r=0,n=t.toString(),e=i.toString();try{r+=n.split(".")[1].length}catch{}try{r+=e.split(".")[1].length}catch{}return Number(n.replace(".",""))*Number(e.replace(".",""))/Math.pow(10,r)}function a(t,i){let r,n,e,o;try{r=t.toString().split(".")[1].length}catch{r=0}try{n=i.toString().split(".")[1].length}catch{n=0}return e=Math.pow(10,Math.max(r,n)),o=r>=n?r:n,((t*e-i*e)/e).toFixed(o)}function p(t,i=!0){return t==="--"?"--":i?t==="NaN"||Number(t)===0?"0":t<1e3&&t>0||t<0&&t>-1e3?t:s(t,1e4).toFixed(2)+"W":t}function f(t){return t==="NaN"||Number(t)===0?"0W":s(t,1e4).toFixed(2)+"W"}function l(t=[]){const i=Object.keys(t[0]);return t.reduce((r,n)=>i.reduce((e,o)=>({...e,[o]:u(r[o]||0,n[o])}),{}),{})}function m(t){return t?Number(t).toFixed(2):0}export{u as a,f as b,l as c,s as d,m as f,h as m,a as s,p as u};