Commit 2b6bad13 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 250ed15f
......@@ -35,12 +35,14 @@ async function format(name) {
let list=[]
let pluser=0
let allProfit=0
for (let i = 1; i <(res.length-1); i ++) {
let d=res[i].split(',')
try {
let profit=parseFloat(d[7])
if (profit<0)
{
allProfit=allProfit+profit
pluser++
}
else
......@@ -60,6 +62,7 @@ let d=res[i].split(',')
let arr2=_.uniq(list)
arr2=_.orderBy(arr2)
let arr=[]
for (let i=0;i<arr2.length;i++)
{
let counter=0
......@@ -69,6 +72,7 @@ let d=res[i].split(',')
arr.push({number:arr2[i],count:counter})
}
console.log('Avg Profit:'+(allProfit/list.length))
console.log(arr)
// arr= await Promise.all(arr)
// //console.log(arr)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment