mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 08:38:45 +05:00
Cast directly interface as float64
This commit is contained in:
committed by
Dan Christian Bogos
parent
f80bad92fc
commit
5eebc6c71e
@@ -41,7 +41,6 @@ func (lcs *LeastCostSorter) SortSuppliers(prflID string,
|
||||
Sorting: lcs.sorting,
|
||||
SortedSuppliers: make([]*SortedSupplier, 0)}
|
||||
for _, s := range suppls {
|
||||
utils.Logger.Debug(fmt.Sprintf("s : %+v \n", s))
|
||||
costData, err := lcs.spS.costForEvent(ev, s.AccountIDs, s.RatingPlanIDs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -51,12 +50,7 @@ func (lcs *LeastCostSorter) SortSuppliers(prflID string,
|
||||
utils.SupplierS, prflID, s.ID))
|
||||
continue
|
||||
}
|
||||
cost, err := utils.IfaceAsFloat64(costData[utils.Cost])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if cost > *lcs.spS.maxCost && *lcs.spS.maxCost != 0 {
|
||||
if costData[utils.Cost].(float64) > *lcs.spS.maxCost && *lcs.spS.maxCost != 0 {
|
||||
continue
|
||||
}
|
||||
srtData := map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user