mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-14 12:49:54 +05:00
value formula string method
This commit is contained in:
@@ -562,7 +562,8 @@ func (self *ApierV1) GetActions(actsId string, reply *[]*utils.TPAction) error {
|
||||
return utils.NewErrServerError(err)
|
||||
}
|
||||
for _, engAct := range engActs {
|
||||
act := &utils.TPAction{Identifier: engAct.ActionType,
|
||||
act := &utils.TPAction{
|
||||
Identifier: engAct.ActionType,
|
||||
ExpiryTime: engAct.ExpirationString,
|
||||
ExtraParameters: engAct.ExtraParameters,
|
||||
Filter: engAct.Filter,
|
||||
@@ -571,7 +572,7 @@ func (self *ApierV1) GetActions(actsId string, reply *[]*utils.TPAction) error {
|
||||
bf := engAct.Balance
|
||||
if bf != nil {
|
||||
act.BalanceType = bf.GetType()
|
||||
act.Units = strconv.FormatFloat(bf.GetValue(), 'f', -1, 64)
|
||||
act.Units = bf.Value.String()
|
||||
act.Directions = bf.GetDirections().String()
|
||||
act.DestinationIds = bf.GetDestinationIDs().String()
|
||||
act.RatingSubject = bf.GetRatingSubject()
|
||||
|
||||
@@ -37,6 +37,10 @@ var ValueFormulas = map[string]valueFormula{
|
||||
INCREMENTAL: incrementalFormula,
|
||||
}
|
||||
|
||||
func (vf *ValueFormula) String() string {
|
||||
return ToJSON(vf)
|
||||
}
|
||||
|
||||
func incrementalFormula(params map[string]interface{}) float64 {
|
||||
// check parameters
|
||||
unitsInterface, unitsFound := params["Units"]
|
||||
|
||||
Reference in New Issue
Block a user