This blog is relevant to version 4.1 or older version of Helical Insight Enterprise version.
Rounding Decimal Values in Card Widget Using JS Post-Fetch Method in Helical Insight Application
- Open the application create a sample card visualization
- To apply rounding functionality using js post fetch method
- Click on update to apply the script
- See the screenshot of result with rounded to 2 decimals
Open the editor and paste the below script
hi_container.set("postFetch",function(c){ var getData = c.get('responseData'); getData .data[0].avg_salary = getData .data[0].avg_salary.toFixed(2); c.set('responseData', getData); });
Note: avg_salary is the column name, make sure that column name should not have spaces, in the place of 2 we can give 3,4,5,6 (based on the nunber of digits to be rounded), etc.
In case if you have any queries please get us at support@helicalinsight.com
Thank You