mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 16:48:45 +05:00
Updated RoundingDecimals
This commit is contained in:
committed by
Dan Christian Bogos
parent
2c9bfbbe7f
commit
e9bbe666df
@@ -313,10 +313,15 @@ func (cdr *CDR) combimedCdrFieldVal(cfgCdrFld *config.FCTemplate, groupCDRs []*C
|
||||
func (cdr *CDR) exportFieldValue(cfgCdrFld *config.FCTemplate, filterS *FilterS) (retVal string, err error) {
|
||||
for _, rsrFld := range cfgCdrFld.Value {
|
||||
var cdrVal string
|
||||
var roundDec int
|
||||
switch cfgCdrFld.Path {
|
||||
case utils.MetaExp + utils.NestingSep + utils.COST:
|
||||
cdrVal = cdr.FormatCost(cfgCdrFld.CostShiftDigits,
|
||||
cfgCdrFld.RoundingDecimals)
|
||||
if cfgCdrFld.RoundingDecimals == nil {
|
||||
roundDec = config.CgrConfig().GeneralCfg().RoundingDecimals
|
||||
} else {
|
||||
roundDec = *cfgCdrFld.RoundingDecimals
|
||||
}
|
||||
cdrVal = cdr.FormatCost(cfgCdrFld.CostShiftDigits, roundDec)
|
||||
case utils.MetaExp + utils.NestingSep + utils.SetupTime:
|
||||
if cfgCdrFld.Layout == "" {
|
||||
cfgCdrFld.Layout = time.RFC3339
|
||||
|
||||
@@ -185,7 +185,7 @@ func TestExportVoiceWithConvert(t *testing.T) {
|
||||
Path: "*exp.Cost",
|
||||
Type: "*composed",
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.MetaReq+utils.NestingSep+"Cost", true, utils.INFIELD_SEP),
|
||||
RoundingDecimals: 5},
|
||||
RoundingDecimals: utils.IntPointer(5)},
|
||||
}
|
||||
cdrVoice := &CDR{
|
||||
CGRID: utils.Sha1("dsafdsaf", time.Unix(1383813745, 0).UTC().String()),
|
||||
@@ -324,7 +324,7 @@ func TestExportWithFilter(t *testing.T) {
|
||||
Path: "*exp.Cost",
|
||||
Type: "*composed",
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.MetaReq+utils.NestingSep+"Cost", true, utils.INFIELD_SEP),
|
||||
RoundingDecimals: 5},
|
||||
RoundingDecimals: utils.IntPointer(5)},
|
||||
}
|
||||
cdrVoice := &CDR{
|
||||
CGRID: utils.Sha1("dsafdsaf", time.Unix(1383813745, 0).UTC().String()),
|
||||
@@ -462,7 +462,7 @@ func TestExportWithFilter2(t *testing.T) {
|
||||
Path: "*exp.Cost",
|
||||
Type: "*composed",
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+utils.MetaReq+utils.NestingSep+"Cost", true, utils.INFIELD_SEP),
|
||||
RoundingDecimals: 5},
|
||||
RoundingDecimals: utils.IntPointer(5)},
|
||||
}
|
||||
cdrVoice := &CDR{
|
||||
CGRID: utils.Sha1("dsafdsaf", time.Unix(1383813745, 0).UTC().String()),
|
||||
|
||||
Reference in New Issue
Block a user