fix percentage for destinations when is notional (#389)
This commit is contained in:
parent
598db1b876
commit
b02d602b14
|
@ -268,9 +268,6 @@ func (c *Controller) createChainActivityResponse(activity []transactions.ChainAc
|
|||
percentage, _ := item.Volume.Div(total).Mul(oneHundred).Float64()
|
||||
item.Percentage = percentage
|
||||
}
|
||||
if isNotional {
|
||||
item.Volume = convertToDecimal(item.Volume)
|
||||
}
|
||||
for i, destination := range item.Destinations {
|
||||
if item.Volume.GreaterThan(decimal.Zero) {
|
||||
percentage, _ := destination.Volume.Div(item.Volume).Mul(oneHundred).Float64()
|
||||
|
@ -280,6 +277,9 @@ func (c *Controller) createChainActivityResponse(activity []transactions.ChainAc
|
|||
item.Destinations[i].Volume = convertToDecimal(destination.Volume)
|
||||
}
|
||||
}
|
||||
if isNotional {
|
||||
item.Volume = convertToDecimal(item.Volume)
|
||||
}
|
||||
txs = append(txs, *item)
|
||||
}
|
||||
return txs, nil
|
||||
|
|
Loading…
Reference in New Issue