Need a special offer?Find out if your project fits.
+

Formatting all measures without decimals.

Answered
kumar asked on April 5, 2016

Hi,
Is there any property or function using it to display all measures are with zero decimals (through code)?
we are using json datasource.

Thanks & regards,
Sunil

3 answers

Public
Ian Sadovy Ian Sadovy Flexmonster April 5, 2016

Hello Sunil,
 
Thank you for the question.
Sure, it's possible. All you need is to add default format for all measures as follows:

var report = {
...
formats: [{
name: "", // name="" means default format for all measures
decimalPlaces: 0
}]
...
}

Please check live sample - https://jsfiddle.net/iansadovy/cwyd27xw/
Also, there is a demo on our site with more configurations available (conditional formatting, formulas, etc.) - https://www.flexmonster.com/demos/js/loading-json-and-csv-file/
Please let me know if it works for you.
 
Regards,
Ian

Public
kumar April 5, 2016

Hi Ian,
Thanks for the quick solution, it's working for me.
 
Thanks,
Sunil

Public
Tanya Gryshko Tanya Gryshko Flexmonster December 7, 2016

Hello Sunil and all Flexmonster users,
After the release of version 2.3, we would like to provide you with the updated sample: https://jsfiddle.net/flexmonster/u09jbyb3/.
Regards,
Tanya

Please login or Register to Submit Answer