Commit acffb2e5 authored by Ahmad Nemati's avatar Ahmad Nemati

git pull

parent 43f717e9
...@@ -47,11 +47,30 @@ let arrNew=[] ...@@ -47,11 +47,30 @@ let arrNew=[]
} }
arrNew = _.orderBy(arrNew, ['sum']) arrNew = _.orderBy(arrNew, ['sum'])
console.log(arr) // console.log(arr)
console.log('Balance ->',balance) console.log('Balance ->',balance)
console.log('Worth ->',arrNew[0]) console.log('Worth ->',arrNew[0])
console.log('Detail ->',get(arrNew[0].date)) console.log('Detail ->',get(arrNew[0].date))
let index=arrNew[0].index
arrNew=[]
for (let i = index; i < index+1; i++) {
let sums = 0
for (let j = i + 1; j < arr.length ; j++) {
sums = sums + parseFloat(arr[j].profit)
if (arrNew.length ===0)
arrNew.push({sum: sums, index: i,date:arr[j].date})
else if (arrNew[arrNew.length-1].sum > sums)
arrNew.push({sum: sums, index: i,date:arr[j].date})
}
}
console.log(arrNew)
} }
......
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