We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

Average decimal rounding

Answered
dongbeom Kim asked on October 6, 2020

Is the average of value decimal control possible?
I want to truncate the decimal point.

Attachments:
Average.png

1 answer

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster October 6, 2020

Hello,
 
Thank you for reaching out to us.
 
We suggest using the decimalPlaces property of the Format Object to truncate the number of decimals.
The detailed guide on number formatting can be found in our documentation.
 
Also, we have prepared a dedicated JSFiddle. It demonstrates the way to limit the number of decimals of the "Quantity" measure:

"slice": {
  "measures": [
  {
    "uniqueName": "Quantity",
    "aggregation": "average",
    "format": "-7jtsxha85u600"
  },
  ...
  ]
},
"formats": [{
  "name": "-7jtsxha85u600",
  "decimalPlaces": 2
}]

 
Please let us know if it works for you.
Our team is looking forward to your feedback.
 
Best regards,
Illia

Please login or Register to Submit Answer