GetTotalValue rounding

This commit is contained in:
Radu Ioan Fericean
2016-03-05 11:23:03 +02:00
parent 25e8559568
commit ca0d29d605
2 changed files with 2 additions and 1 deletions

View File

@@ -349,7 +349,7 @@ func TestDmtAgentSendCCRTerminate(t *testing.T) {
if err := apierRpc.Call("ApierV2.GetAccount", attrs, &acnt); err != nil {
t.Error(err)
} else if acnt.BalanceMap[utils.MONETARY].GetTotalValue() != eAcntVal { // Should also consider derived charges which double the cost of 6m10s - 2x0.7584
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.MONETARY].GetTotalValue())
t.Errorf("Expected: %v, received: %v", eAcntVal, acnt.BalanceMap[utils.MONETARY].GetTotalValue())
}
}

View File

@@ -617,6 +617,7 @@ func (bc Balances) GetTotalValue() (total float64) {
total += b.GetValue()
}
}
total = utils.Round(total, globalRoundingDecimals, utils.ROUNDING_MIDDLE)
return
}